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:
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 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:
|
||||
|
Loading…
Reference in New Issue
Block a user