-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/pip/mypy-eq-1.5.star
- Loading branch information
Showing
8 changed files
with
150 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[ | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[ | ||
{ | ||
"active": false, | ||
"code": "F383", | ||
"date_created": "1928-05-12T00:00:00", | ||
"date_deleted": "1991-12-09T00:00:00", | ||
"name": "Monserrato", | ||
"name_alt": "", | ||
"name_alt_trans": "", | ||
"name_slugs": [ | ||
"monserrato" | ||
], | ||
"name_trans": "Monserrato", | ||
"province": "CA" | ||
}, | ||
{ | ||
"active": false, | ||
"code": "G133", | ||
"date_created": "1928-11-28T00:00:00", | ||
"date_deleted": "1948-04-07T00:00:00", | ||
"name": "Ortacesus", | ||
"name_alt": "", | ||
"name_alt_trans": "", | ||
"name_slugs": [ | ||
"ortacesus" | ||
], | ||
"name_trans": "Ortacesus", | ||
"province": "CA" | ||
}, | ||
{ | ||
"active": false, | ||
"code": "L513", | ||
"date_created": "1927-11-04T00:00:00", | ||
"date_deleted": "1946-02-27T00:00:00", | ||
"name": "Ussaramanna", | ||
"name_alt": "", | ||
"name_alt_trans": "", | ||
"name_slugs": [ | ||
"ussaramanna" | ||
], | ||
"name_trans": "Ussaramanna", | ||
"province": "CA" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
coverage == 7.2.* | ||
coverage == 7.3.* | ||
mypy == 1.5.* | ||
pre-commit == 3.3.* | ||
tox == 4.6.* | ||
tox == 4.11.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import datetime | ||
import unittest | ||
|
||
from codicefiscale import codicefiscale | ||
|
||
|
||
class Issue0113TestCase(unittest.TestCase): | ||
def test_issue_0113(self): | ||
""" | ||
Wrong birthplace code error (missing date-range in the data-source). | ||
""" | ||
codes = [ | ||
"XXXXXX39D44G133O", | ||
"XXXXXX46D11F383M", | ||
"XXXXXX50H18F383N", | ||
"XXXXXX38C71L513V", | ||
"XXXXXX43C14G133F", | ||
] | ||
expected_birthdates = [ | ||
datetime.datetime(1939, 4, 4, 0, 0), | ||
datetime.datetime(1946, 4, 11, 0, 0), | ||
datetime.datetime(1950, 6, 18, 0, 0), | ||
datetime.datetime(1938, 3, 31, 0, 0), | ||
datetime.datetime(1943, 3, 14, 0, 0), | ||
] | ||
for index, code in enumerate(codes): | ||
with self.subTest(f"code: {code}"): | ||
code_data = codicefiscale.decode(code) | ||
code_data.pop("omocodes") | ||
code_data.pop("raw") | ||
# print(code_data) | ||
self.assertEqual(code_data["birthdate"], expected_birthdates[index]) |