summaryrefslogtreecommitdiff
path: root/tests/integration/test_accesslist.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/test_accesslist.py')
-rw-r--r--tests/integration/test_accesslist.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/integration/test_accesslist.py b/tests/integration/test_accesslist.py
index 7d01264..3ed8ddf 100644
--- a/tests/integration/test_accesslist.py
+++ b/tests/integration/test_accesslist.py
@@ -7,6 +7,7 @@ produces: an empty file, and a last line with no newline after it.
7 7
8import os 8import os
9import struct 9import struct
10import time
10import unittest 11import unittest
11 12
12from harness import Tracker, TrackerTestCase 13from harness import Tracker, TrackerTestCase
@@ -109,9 +110,10 @@ class ListIsInPlaceBeforeTheStateFile(TrackerTestCase):
109 files = {"blacklist": listing(BLOCKED)} 110 files = {"blacklist": listing(BLOCKED)}
110 111
111 def test_a_blacklisted_torrent_in_a_state_file_is_not_restored(self): 112 def test_a_blacklisted_torrent_in_a_state_file_is_not_restored(self):
113 touched = int(time.time()) // 60 - 5
112 path = os.path.join(self.tracker.dir, "state") 114 path = os.path.join(self.tracker.dir, "state")
113 with open(path, "w") as handle: 115 with open(path, "w") as handle:
114 handle.write("%s:5:7\n%s:5:7\n" % (BLOCKED.hex(), ALLOWED.hex())) 116 handle.write("%s:%d:7\n%s:%d:7\n" % (BLOCKED.hex(), touched, ALLOWED.hex(), touched))
115 117
116 restarted = Tracker(self.config, self.files, extra_args=["-l", path]) 118 restarted = Tracker(self.config, self.files, extra_args=["-l", path])
117 try: 119 try: