Skip to content

Commit

Permalink
fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
noviluni committed Nov 23, 2020
1 parent 01b62a7 commit e9359fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import dateparser

# print(dateparser.parse('Fri Jan 26 16:32:21 +0000 2018', date_formats=['%a %b %d %H:%M:%S %z %Y']))
# print(dateparser.parse(date_string="14 giu 13", date_formats=["%y %B %d"]))

print(dateparser.parse(date_string="Mon, 25 Jun 2018 10:37:47 +0530 "))
9 changes: 5 additions & 4 deletions tests/test_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,11 @@ def test_should_parse_date(self, date_string, date_formats, expected_result):
expected_result=datetime(2018, 1, 26, 16, 32, 21)),
param(date_string='15/04/1904 14:05 +0004', date_formats=['%d/%m/%Y %H:%M %z'],
expected_result=datetime(1904, 4, 15, 14, 5, tzinfo=timezone(timedelta(0, 240)))),
param(date_string='20-05-1994 23:00 GMT', date_formats=['%d-%m-%Y %H:%M %Z'],
expected_result=datetime(
1994, 5, 20, 23, 0, tzinfo=StaticTzInfo('GMT', timedelta(seconds=0))
)),
param(
date_string='20-05-1994 23:00 GMT', date_formats=['%d-%m-%Y %H:%M %Z'], expected_result=datetime(
1994, 5, 20, 23, 0, tzinfo=StaticTzInfo('GMT', timedelta(seconds=0))
)
),
])
def test_should_parse_localized_dates(self, date_string, date_formats, expected_result):
self.when_date_is_parsed_with_formats(date_string, date_formats)
Expand Down

0 comments on commit e9359fe

Please sign in to comment.