Пример #1
0
 def on_trashinfo_with_date_parse_to_date(self):
     from datetime import datetime
     example_date_as_string = '2001-01-01T00:00:00'
     same_date_as_datetime = datetime(2001, 1, 1)
     assert_equals(
         same_date_as_datetime,
         maybe_parse_deletion_date(make_trashinfo(example_date_as_string)))
 def on_trashinfo_with_invalid_date_parse_to_unknown_date(self):
     invalid_date='A long time ago'
     assert_equals(UNKNOWN_DATE,
                   maybe_parse_deletion_date(make_trashinfo(invalid_date)))
 def on_trashinfo_with_date_parse_to_date(self):
     from datetime import datetime
     example_date_as_string='2001-01-01T00:00:00'
     same_date_as_datetime=datetime(2001,1,1)
     assert_equals(same_date_as_datetime, 
                   maybe_parse_deletion_date(make_trashinfo(example_date_as_string)))
 def on_trashinfo_without_date_parse_to_unknown_date(self):
     assert_equals(UNKNOWN_DATE, 
                   maybe_parse_deletion_date(a_trashinfo_without_deletion_date()))
Пример #5
0
 def test_on_trashinfo_without_date_parse_to_unknown_date(self):
     assert (UNKNOWN_DATE == maybe_parse_deletion_date(
         a_trashinfo_without_deletion_date()))