pql
pql copied to clipboard
some date related tests are failing
cward@cward pql [master] $ python -m unittest find_tests
...........F.F...................
FAIL: test_date (find_tests.PqlSchemaLessTestCase)
Traceback (most recent call last): File "find_tests.py", line 92, in test_date self.compare('a == date(10)', {'a': datetime(1969, 12, 31, 19, 0, 10)}) File "find_tests.py", line 10, in compare self.assertEqual(pql.find(string), expected) AssertionError: {'a': datetime.datetime(1970, 1, 1, 1, 0, 10)} != {'a': datetime.datetime(1969, 12, 31, 19, 0, 10)}
- {'a': datetime.datetime(1970, 1, 1, 1, 0, 10)}
- {'a': datetime.datetime(1969, 12, 31, 19, 0, 10)}
FAIL: test_epoch (find_tests.PqlSchemaLessTestCase)
Traceback (most recent call last): File "find_tests.py", line 99, in test_epoch self.compare('a == epoch("2012")', {'a': 1340164800}) File "find_tests.py", line 10, in compare self.assertEqual(pql.find(string), expected) AssertionError: {'a': 1345068000.0} != {'a': 1340164800}
- {'a': 1345068000.0} ? - ---
- {'a': 1340164800} ? + +
Ran 33 tests in 0.007s
FAILED (failures=2)
i suppose this is because of datetime localization; my local system, where i'm running the tests, is in CEST; or UTC+1
It even fails for me since, probably because daylight savings and such. I'll fix it soon. thanks!