Example #1
0
 def test__fast_parse_utc_datestring_no_microseconds(self):
     expected_value = datetime(2047, 1, 6, 8, 21, tzinfo=tzutc())
     assert _fast_parse_utc_datestring(
         '2047-01-06T08:21:00.0+0000') == expected_value
Example #2
0
 def test__fast_parse_utc_datestring_invalid_input(self, invalid_string):
     with pytest.raises(ValueError, match="does not match format"):
         _fast_parse_utc_datestring(invalid_string)
Example #3
0
 def test__fast_parse_utc_datestring_roundtrips(self):
     tstamp = datetime.now(UTC)
     tstamp_str = tstamp.strftime(DATETIME_FORMAT)
     assert _fast_parse_utc_datestring(tstamp_str) == tstamp