1
0
Fork 0
mirror of https://github.com/topydo/topydo.git synced 2024-05-20 05:48:35 +00:00

Fix geo test time errors in tests

The freezetime decorator was giving a time of the previous day if
the test was run for time zones west of Greenwich.
This commit is contained in:
David Steele 2020-03-03 13:37:01 -05:00
parent e7ffc32168
commit 715a7216b7
3 changed files with 7 additions and 4 deletions

View file

@ -18,6 +18,7 @@ import codecs
import os
import re
import sys
import time
import unittest
from collections import namedtuple
@ -592,7 +593,7 @@ class ListCommandIcalTest(CommandTest):
self.assertEqual(self.errors, "")
@freeze_time('2016, 11, 17')
@freeze_time('2016-11-17 00:00:00', tz_offset = time.timezone/3600)
class ListCommandDotTest(CommandTest):
def setUp(self):
self.maxDiff = None
@ -615,7 +616,7 @@ class ListCommandDotTest(CommandTest):
self.assertEqual(self.errors, "")
@freeze_time('2016, 12, 6')
@freeze_time('2016-12-6 00:00:00', tz_offset = time.timezone/3600)
class ListCommandGroupTest(CommandTest):
def test_group1(self):
todolist = load_file_to_todolist("test/data/ListCommandGroupTest.txt")

View file

@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import time
import unittest
from collections import namedtuple
@ -35,7 +36,7 @@ except ImportError:
import mock
@freeze_time("2015, 11, 06")
@freeze_time("2015-11-06 00:00:00", tz_offset = time.timezone/3600)
class ListFormatTest(CommandTest):
def setUp(self):
super().setUp()

View file

@ -16,6 +16,7 @@
import os
import tempfile
import time
import unittest
from datetime import date
from glob import glob
@ -61,7 +62,7 @@ def command_executer(p_cmd, p_args, p_todolist, p_archive=None, *params):
archive_command.execute()
@freeze_time('2015, 11, 06')
@freeze_time('2015-11-06 00:00:00', tz_offset=time.timezone/3600)
class RevertCommandTest(CommandTest):
def setUp(self):
super().setUp()