Public bug reported:
test/unittests/test_report.py::test_ts_to_dt assumes UTC timezone.
Therefore, running autopkgtest from a machine with a different timezone
set will trigger an error in the dep8 test suite for crmsh.
=================================== FAILURES ===================================
_________________________________ test_get_ts __________________________________
def test_get_ts():
> assert ts_to_dt(get_ts(line5424_1)).strftime("%Y/%m/%d %H:%M") ==
> "2017/01/26 03:04"
E AssertionError: assert '2017/01/26 00:04' == '2017/01/26 03:04'
E - 2017/01/26 03:04
E ? ^
E + 2017/01/26 00:04
E ? ^
test_report.py:220: AssertionError
----------------------------- Captured stdout call -----------------------------
ERROR: parse_time 2017-01-26T11:04:19.562885+08:00 12sp2-4 kernel:: Unknown
string format: 2017-01-26T11:04:19.562885+08:00 12sp2-4 kernel:
INFO: autopkgtest# the log file is in the rfc5424 format
________________________________ test_ts_to_dt _________________________________
def test_ts_to_dt():
ts1 = crmsh.utils.parse_to_timestamp("2pm")
ts2 = crmsh.utils.parse_to_timestamp("2007/9/5 12:30")
ts3 = crmsh.utils.parse_to_timestamp("1:00")
ts4 = crmsh.utils.parse_to_timestamp("09-Sep-15 2:00")
ts5 = crmsh.utils.parse_to_timestamp("2017-06-01T14:27:08.412531+08:00")
assert ts_to_dt(ts1).strftime("%-I%P") == "2pm"
assert ts_to_dt(ts2).strftime("%Y/%-m/%-d %H:%M") == "2007/9/5 12:30"
assert ts_to_dt(ts3).strftime("%-H:%M") == "1:00"
assert ts_to_dt(ts4).strftime("%d-%b-%y %-H:%M") == "09-Sep-15 2:00"
> assert ts_to_dt(ts5).strftime("%Y/%m/%d %H:%M:%S") == "2017/06/01
> 06:27:08"
E AssertionError: assert '2017/06/01 03:27:08' == '2017/06/01 06:27:08'
E - 2017/06/01 06:27:08
E ? ^
E + 2017/06/01 03:27:08
E ? ^
test_report.py:326: AssertionError
** Affects: crmsh (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1958243
Title:
crmsh unit tests assume UTC timezone
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/crmsh/+bug/1958243/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs