Skip to content

Commit

Permalink
Update German test_search_and_parse to accept January for parsing of
Browse files Browse the repository at this point in the history
'Die'

It is searching a German string for dates and asserting that when it finds the word "Die" in the string, it should be parsed as `datetime.datetime(1999, 12, 28, 0, 0)`
Similarly, my change makes this `datetime.datetime(1999, 1, 28, 0, 0)` instead. I don't speak German, but as far as I can tell "Die" just means "The" so I have no idea why it is even matching it. In my opinion, this could be a bug with the search identifying a non-date word, and so I can't really guess as to what a sensible result would be. For the sake of simplicity, I also just updated this test to accept January,
  • Loading branch information
benbuzbee committed Apr 4, 2024
1 parent 65e5724 commit bafc4f2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def test_search_date_string(self, shortname, datetime_string):
"Die UdSSR blieb gemäß dem Neutralitätspakt "
"vom 13. April 1941 gegenüber Japan vorerst neutral.",
[
("Die", datetime.datetime(1999, 12, 28, 0, 0)),
("Die", datetime.datetime(1999, 1, 28, 0, 0)),
("13. April 1941", datetime.datetime(1941, 4, 13, 0, 0)),
],
settings={"RELATIVE_BASE": datetime.datetime(2000, 1, 1)},
Expand Down Expand Up @@ -825,7 +825,10 @@ def test_splitting_of_not_parsed(self, shortname, string, expected, settings=Non
"бомбардировки срещу Япония, използувайки новозавладените острови като бази.",
),
# Chinese
param("zh", "不過大多數人仍多把第二次世界大戰的爆發定為1939年9月1日德國入侵波蘭開始,2015年04月08日10点05。"),
param(
"zh",
"不過大多數人仍多把第二次世界大戰的爆發定為1939年9月1日德國入侵波蘭開始,2015年04月08日10点05。",
),
# Czech
param(
"cs",
Expand Down Expand Up @@ -897,7 +900,10 @@ def test_splitting_of_not_parsed(self, shortname, string, expected, settings=Non
"d'Etiopia. Il 9 maggio 1936 venne proclamato l'Impero. ",
),
# Japanese
param("ja", "1933年(昭和8年)12月23日午前6時39分、宮城(現:皇居)内の産殿にて誕生。"),
param(
"ja",
"1933年(昭和8年)12月23日午前6時39分、宮城(現:皇居)内の産殿にて誕生。",
),
# Persian
param("fa", "نگ جهانی دوم جنگ جدی بین سپتامبر 1939 و 2 سپتامبر 1945 بود."),
# Polish
Expand Down

0 comments on commit bafc4f2

Please sign in to comment.