Skip to content

Commit 34fb258

Browse files
committed
SDK-1443: Split only on space, not whitespace and check for empty string
1 parent 2b588a2 commit 34fb258

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

yoti_python_sdk/document_details.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def issuing_authority(self):
2727
return self.__dict__.get("_DocumentDetails__issuing_authority", None)
2828

2929
def __parse_data(self, data):
30-
data = data.split()
31-
if len(data) < 3:
30+
data = data.split(" ")
31+
if len(data) < 3 or "" in data:
3232
raise ValueError("Invalid value for DocumentDetails")
3333

3434
self.__document_type = data[0]

yoti_python_sdk/tests/test_document_details.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def test_invalid_date():
125125

126126

127127
def test_should_fail_with_double_space():
128-
DATA = " IND ****1234"
128+
DATA = "AADHAAR IND ****1234"
129129

130130
with pytest.raises(ValueError) as exc:
131131
DocumentDetails(DATA)

0 commit comments

Comments
 (0)