1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-09 09:59:51 +01:00

freeze timezone to make tests deterministic

This commit is contained in:
Michele Guerini Rocco 2020-05-21 15:10:47 +02:00
parent 130a4292a2
commit c54c19ac01
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450
2 changed files with 9 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,8 @@ from unittest.mock import patch, MagicMock
import io
import urllib
import json
import os
import time
import pirate.torrent
import pirate.data
@ -14,6 +16,12 @@ from tests import util
class TestTorrent(unittest.TestCase):
@classmethod
def setUpClass(cls):
# to make test deterministic
os.environ['TZ'] = 'Etc/UTC'
time.tzset()
def test_no_hits(self):
expected = []
with util.open_data('no_hits.json') as res: