danielrichman / strict-rfc3339

Strict, simple, lightweight RFC3339 functions
GNU General Public License v3.0
31 stars 13 forks source link

Dependency on timezone #9

Open jayvdb opened 4 years ago

jayvdb commented 4 years ago

When I run the test suite on a linux VM without timezone, lots of tests fail, but there is no exception indicating that there is a missing dependency.

Apteryks commented 2 years ago

I got that too:

test_dst_transition (test_strict_rfc3339.TestRFC3339toTimestamp) ... ok
test_float (test_strict_rfc3339.TestRFC3339toTimestamp) ... ok
test_leap_year (test_strict_rfc3339.TestRFC3339toTimestamp) ... ok
test_simple_cases (test_strict_rfc3339.TestRFC3339toTimestamp) ... ok
test_validates (test_strict_rfc3339.TestRFC3339toTimestamp) ... ok
test_wacky_offset (test_strict_rfc3339.TestRFC3339toTimestamp) ... ok
test_y2038 (test_strict_rfc3339.TestRFC3339toTimestamp) ... ok
test_dst_transition (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetLondon) ... FAIL
test_float (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetLondon) ... FAIL
test_now (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetLondon) ... ok
test_simple_cases (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetLondon) ... FAIL
test_dst_transition (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetNewYork) ... FAIL
test_float (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetNewYork) ... FAIL
test_now (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetNewYork) ... FAIL
test_simple_cases (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetNewYork) ... FAIL
test_float (test_strict_rfc3339.TestTimestampToRFC3339UTCOffset) ... ok
test_leap_year (test_strict_rfc3339.TestTimestampToRFC3339UTCOffset) ... ok
test_now (test_strict_rfc3339.TestTimestampToRFC3339UTCOffset) ... ok
test_simple_cases (test_strict_rfc3339.TestTimestampToRFC3339UTCOffset) ... ok
test_y2038 (test_strict_rfc3339.TestTimestampToRFC3339UTCOffset) ... ok
test_accepts_good (test_strict_rfc3339.TestValidateRFC3339) ... ok
test_handles_leapyear (test_strict_rfc3339.TestValidateRFC3339) ... ok
test_rejects_bad_format (test_strict_rfc3339.TestValidateRFC3339) ... ok
test_rejects_leap_seconds (test_strict_rfc3339.TestValidateRFC3339) ... ok
test_rejects_no_offset (test_strict_rfc3339.TestValidateRFC3339) ... ok
test_rejects_out_of_range (test_strict_rfc3339.TestValidateRFC3339) ... ok
test_rejects_trailing (test_strict_rfc3339.TestValidateRFC3339) ... ok
test_rejects_year_0 (test_strict_rfc3339.TestValidateRFC3339) ... ok

======================================================================
FAIL: test_dst_transition (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetLondon)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-python-strict-rfc3339-0.7.drv-0/source/test_strict_rfc3339.py", line 220, in test_dst_transition
    assert self.func(1332637200) == "2012-03-25T02:00:00+01:00"
AssertionError

======================================================================
FAIL: test_float (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetLondon)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-python-strict-rfc3339-0.7.drv-0/source/test_strict_rfc3339.py", line 226, in test_float
    assert self.func(1344457836.005) == "2012-08-08T21:30:36.005+01:00"
AssertionError

======================================================================
FAIL: test_simple_cases (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetLondon)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-python-strict-rfc3339-0.7.drv-0/source/test_strict_rfc3339.py", line 212, in test_simple_cases
    assert self.func(1344457836) == "2012-08-08T21:30:36+01:00"
AssertionError

======================================================================
FAIL: test_dst_transition (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetNewYork)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-python-strict-rfc3339-0.7.drv-0/source/test_strict_rfc3339.py", line 267, in test_dst_transition
    assert self.func(1331449199) == "2012-03-11T01:59:59-05:00"
AssertionError

======================================================================
FAIL: test_float (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetNewYork)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-python-strict-rfc3339-0.7.drv-0/source/test_strict_rfc3339.py", line 273, in test_float
    assert self.func(851042397.1234) == "1996-12-19T19:39:57.1234-05:00"
AssertionError

======================================================================
FAIL: test_now (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetNewYork)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-python-strict-rfc3339-0.7.drv-0/source/test_strict_rfc3339.py", line 280, in test_now
    assert s[-6:] == ["-05:00", "-04:00"][time.localtime(w).tm_isdst]
AssertionError

======================================================================
FAIL: test_simple_cases (test_strict_rfc3339.TestTimestampToRFC3339LocalOffsetNewYork)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-python-strict-rfc3339-0.7.drv-0/source/test_strict_rfc3339.py", line 259, in test_simple_cases
    assert self.func(851042397) == "1996-12-19T19:39:57-05:00"
AssertionError

----------------------------------------------------------------------
Ran 28 tests in 0.012s

FAILED (failures=7)
Test failed: <unittest.runner.TextTestResult run=28 errors=0 failures=7>
error: Test failed: <unittest.runner.TextTestResult run=28 errors=0 failures=7>