Skip to content

Commit 7c7738e

Browse files
fix: run make format
1 parent c642911 commit 7c7738e

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

mati/resources/verifications.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,31 +127,32 @@ def proof_of_life_validation(self) -> Optional[DocumentScore]:
127127
@property
128128
def govt_id_validation(self) -> Optional[DocumentScore]:
129129
return self.get_document_validation(self.govt_id_document)
130-
131130

132131
def get_document_validation(
133-
self,
134-
document: Optional[VerificationDocument]
135-
) -> Optional[DocumentScore]:
132+
self, document: Optional[VerificationDocument]
133+
) -> Optional[DocumentScore]:
136134
if not document:
137-
return None
135+
return None
138136
type = document.type.replace("-", "_")
139137
is_expired = (
140138
self.computed['is_document_expired']['data'][type]
141139
if self.computed
142140
else False
143141
)
144142
steps = document.steps
145-
if is_expired:
146-
steps.append(VerificationDocumentStep(
147-
id=f'{type}_verification',
148-
status=500,
149-
error={
150-
'verification': f'Document {type} expired', 'code': 500
151-
})
143+
if is_expired:
144+
steps.append(
145+
VerificationDocumentStep(
146+
id=f'{type}_verification',
147+
status=500,
148+
error={
149+
'verification': f'Document {type} expired',
150+
'code': 500,
151+
},
152+
)
152153
)
153154
return DocumentScore(
154155
all([step.status == 200 and not step.error for step in steps]),
155156
sum([step.status for step in steps if not step.error]),
156157
[step.error['code'] for step in steps if step.error],
157-
)
158+
)

tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ def verification_without_pol(client: Client):
227227
verification.steps = []
228228
yield verification
229229

230+
230231
@pytest.fixture
231232
def verification_with_govt_expired(client: Client):
232233
verification = client.verifications.retrieve('686c77811ee936aece7016ac')
@@ -237,7 +238,9 @@ def verification_with_govt_expired(client: Client):
237238
@pytest.fixture
238239
def verification_with_poa_expired(client: Client):
239240
verification = client.verifications.retrieve('686c77811ee936aece7016ac')
240-
verification.computed["is_document_expired"]["data"]["proof_of_residency"] = True
241+
verification.computed["is_document_expired"]["data"][
242+
"proof_of_residency"
243+
] = True
241244
yield verification
242245

243246

tests/resources/test_verifications.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def test_retrieve_dni_verification(verification_without_pol):
8080
assert verification.documents[0].document_number == '111'
8181
assert not verification.documents[0].ocr_number
8282

83+
8384
@pytest.mark.vcr
8485
def test_retrive_verification_invalid_govt(verification_with_govt_expired):
8586
verification = verification_with_govt_expired
@@ -91,4 +92,4 @@ def test_retrive_verification_invalid_govt(verification_with_govt_expired):
9192
def test_retrive_verification_invalid_poa(verification_with_poa_expired):
9293
verification = verification_with_poa_expired
9394
assert not verification.proof_of_residency_validation.is_valid
94-
assert verification.proof_of_residency_validation.error_codes
95+
assert verification.proof_of_residency_validation.error_codes

0 commit comments

Comments
 (0)