[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] Move timestmap util tests, and fix them to actually pass



commit 3aa5444c67b4a05059c73810849d882538c6ebbb
Author: Matt Traudt <sirmatt@xxxxxxx>
Date:   Wed Jun 20 20:58:27 2018 -0400

    Move timestmap util tests, and fix them to actually pass
---
 tests/{ => unit}/util/test_timestamp.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/util/test_timestamp.py b/tests/unit/util/test_timestamp.py
similarity index 86%
rename from tests/util/test_timestamp.py
rename to tests/unit/util/test_timestamp.py
index 0ccf2ec..8ebc2f6 100644
--- a/tests/util/test_timestamp.py
+++ b/tests/unit/util/test_timestamp.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """Test timestamp conversion util functions"""
-from datetime import datetime
+from datetime import datetime, timezone
 
 from sbws.util.timestamp import (dt_obj_to_isodt_str, unixts_to_dt_obj,
                                  unixts_to_isodt_str, unixts_to_str)
@@ -8,7 +8,7 @@ from sbws.util.timestamp import (dt_obj_to_isodt_str, unixts_to_dt_obj,
 
 isodt_str = '2018-05-23T12:55:04'
 dt_obj = datetime.strptime(isodt_str, '%Y-%m-%dT%H:%M:%S')
-unixts = int(dt_obj.timestamp())
+unixts = int(dt_obj.replace(tzinfo=timezone.utc).timestamp())
 
 
 def test_dt_obj_to_isodt_str():



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits