55import pytest
66
77from signnow_client .models .document_groups import DocumentGroupV2FieldInvite
8-
98from sn_mcp_server .tools .models import SimplifiedInviteParticipant
109
1110
1211class TestExpirationHandling :
1312 """Test cases for optional expiration_time and expiration_days."""
1413
15- def test_simplified_invite_participant_from_field_invite_with_expiration (self ):
14+ def test_simplified_invite_participant_from_field_invite_with_expiration (self ) -> None :
1615 """Test SimplifiedInviteParticipant.from_document_group_v2_field_invite with expiration."""
1716 now = 1500000000
1817 field_invite = DocumentGroupV2FieldInvite (
@@ -23,7 +22,7 @@ def test_simplified_invite_participant_from_field_invite_with_expiration(self):
2322 expiration_time = 2000000000 , # Future expiration
2423 expiration_days = 30 ,
2524 signer_email = "test@example.com" ,
26- password_protected = "0" ,
25+ password_protected = "0" , # noqa: S106
2726 email_statuses = [],
2827 )
2928 participant = SimplifiedInviteParticipant .from_document_group_v2_field_invite (field_invite , now )
@@ -32,7 +31,7 @@ def test_simplified_invite_participant_from_field_invite_with_expiration(self):
3231 assert participant .expired is False # Not expired yet
3332 assert participant .status == "pending"
3433
35- def test_simplified_invite_participant_from_field_invite_without_expiration (self ):
34+ def test_simplified_invite_participant_from_field_invite_without_expiration (self ) -> None :
3635 """Test SimplifiedInviteParticipant.from_document_group_v2_field_invite without expiration."""
3736 now = 1500000000
3837 field_invite = DocumentGroupV2FieldInvite (
@@ -43,7 +42,7 @@ def test_simplified_invite_participant_from_field_invite_without_expiration(self
4342 expiration_time = None , # No expiration
4443 expiration_days = None ,
4544 signer_email = "test@example.com" ,
46- password_protected = "0" ,
45+ password_protected = "0" , # noqa: S106
4746 email_statuses = [],
4847 )
4948 participant = SimplifiedInviteParticipant .from_document_group_v2_field_invite (field_invite , now )
@@ -52,7 +51,7 @@ def test_simplified_invite_participant_from_field_invite_without_expiration(self
5251 assert participant .expired is False # No expiration means not expired
5352 assert participant .status == "pending"
5453
55- def test_simplified_invite_participant_from_field_invite_expired (self ):
54+ def test_simplified_invite_participant_from_field_invite_expired (self ) -> None :
5655 """Test SimplifiedInviteParticipant.from_document_group_v2_field_invite with expired invite."""
5756 now = 2500000000 # After expiration
5857 field_invite = DocumentGroupV2FieldInvite (
@@ -63,7 +62,7 @@ def test_simplified_invite_participant_from_field_invite_expired(self):
6362 expiration_time = 2000000000 , # Past expiration
6463 expiration_days = 30 ,
6564 signer_email = "test@example.com" ,
66- password_protected = "0" ,
65+ password_protected = "0" , # noqa: S106
6766 email_statuses = [],
6867 )
6968 participant = SimplifiedInviteParticipant .from_document_group_v2_field_invite (field_invite , now )
@@ -72,7 +71,7 @@ def test_simplified_invite_participant_from_field_invite_expired(self):
7271 assert participant .expired is True # Expired
7372 assert participant .status == "expired"
7473
75- def test_simplified_invite_participant_from_field_invite_expired_status (self ):
74+ def test_simplified_invite_participant_from_field_invite_expired_status (self ) -> None :
7675 """Test SimplifiedInviteParticipant.from_document_group_v2_field_invite with expired status."""
7776 now = 1500000000
7877 field_invite = DocumentGroupV2FieldInvite (
@@ -83,7 +82,7 @@ def test_simplified_invite_participant_from_field_invite_expired_status(self):
8382 expiration_time = 2000000000 ,
8483 expiration_days = 30 ,
8584 signer_email = "test@example.com" ,
86- password_protected = "0" ,
85+ password_protected = "0" , # noqa: S106
8786 email_statuses = [],
8887 )
8988 participant = SimplifiedInviteParticipant .from_document_group_v2_field_invite (field_invite , now )
@@ -99,7 +98,7 @@ def test_simplified_invite_participant_from_field_invite_expired_status(self):
9998 ("signed" , 2000000000 , 2500000000 , False ), # Past expiration but signed status (not in PENDING)
10099 ],
101100 )
102- def test_check_expired (self , status : str , expires_at : int | None , now : int , expected : bool ):
101+ def test_check_expired (self , status : str , expires_at : int | None , now : int , expected : bool ) -> None :
103102 """Test check_expired method with various status, expiration, and time combinations."""
104103 result = SimplifiedInviteParticipant .check_expired (status , expires_at , now )
105104 assert result == expected
0 commit comments