Пример #1
0
def test_iso_format_with_time_zone_case_1():
    # python -m pytest tests/unit/time/test_datetime.py -s -v -k test_iso_format_with_time_zone_case_1
    expected = DateTime(2019, 10, 30, 7, 54, 2.129790999, tzinfo=timezone_utc)
    assert expected.iso_format() == "2019-10-30T07:54:02.129790999+00:00"
    assert expected.tzinfo == FixedOffset(0)
    actual = DateTime.from_iso_format("2019-10-30T07:54:02.129790999+00:00")
    assert expected == actual
Пример #2
0
 def test_iso_format_with_trailing_zeroes(self):
     dt = DateTime(2018, 10, 1, 12, 34, 56.789)
     self.assertEqual("2018-10-01T12:34:56.789000000", dt.iso_format())
Пример #3
0
 def test_iso_format(self):
     dt = DateTime(2018, 10, 1, 12, 34, 56.789123456)
     self.assertEqual("2018-10-01T12:34:56.789123456", dt.iso_format())