Skip to content

Commit

Permalink
fix unittest detected errors:
Browse files Browse the repository at this point in the history
strip "<" (left abd right) in alphanum fields (document_number & optional_data & optional_data_2)
  • Loading branch information
Arg0s1080 committed May 3, 2019
1 parent db93574 commit 77610b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mrz/checker/_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def _str_common_fields(self):
self._expiry_date,
self._sex,
self._document_type.rstrip("<"),
self._document_number.rstrip("<"),
self._optional_data.rstrip("<"))
self._document_number.strip("<"),
self._optional_data.strip("<"))
names = ("surname name country nationality birth_date expiry_date sex "
"document_type document_number optional_data ")
return fields, names
Expand Down
2 changes: 1 addition & 1 deletion mrz/checker/td1.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def fields(self):
optional_data_2 and final_hash
"""
extra_fields = self._optional_data_2.rstrip("<"), self._final_hash
extra_fields = self._optional_data_2.strip("<"), self._final_hash
extra_names = "optional_data_2 final_hash"
return namedtuple_maker(self._str_common_fields(), self._str_common_hashes(), extra_fields, extra_names)

Expand Down

0 comments on commit 77610b1

Please sign in to comment.