mirror of
https://github.com/vikstrous/pirate-get
synced 2025-01-10 10:04:21 +01:00
freeze timezone to make tests deterministic
This commit is contained in:
parent
130a4292a2
commit
c54c19ac01
File diff suppressed because one or more lines are too long
@ -5,6 +5,8 @@ from unittest.mock import patch, MagicMock
|
|||||||
import io
|
import io
|
||||||
import urllib
|
import urllib
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
import pirate.torrent
|
import pirate.torrent
|
||||||
import pirate.data
|
import pirate.data
|
||||||
@ -14,6 +16,12 @@ from tests import util
|
|||||||
|
|
||||||
class TestTorrent(unittest.TestCase):
|
class TestTorrent(unittest.TestCase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
# to make test deterministic
|
||||||
|
os.environ['TZ'] = 'Etc/UTC'
|
||||||
|
time.tzset()
|
||||||
|
|
||||||
def test_no_hits(self):
|
def test_no_hits(self):
|
||||||
expected = []
|
expected = []
|
||||||
with util.open_data('no_hits.json') as res:
|
with util.open_data('no_hits.json') as res:
|
||||||
|
Loading…
Reference in New Issue
Block a user