From 355c8ae57d582974f4f6a4ba42f635f2253b84a7 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Fri, 6 Nov 2026 14:24:04 +0100 Subject: Add a wall clock helper so that statedumps can be written and re-read --- tests/integration/test_accesslist.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/integration/test_accesslist.py') 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. import os import struct +import time import unittest from harness import Tracker, TrackerTestCase @@ -109,9 +110,10 @@ class ListIsInPlaceBeforeTheStateFile(TrackerTestCase): files = {"blacklist": listing(BLOCKED)} def test_a_blacklisted_torrent_in_a_state_file_is_not_restored(self): + touched = int(time.time()) // 60 - 5 path = os.path.join(self.tracker.dir, "state") with open(path, "w") as handle: - handle.write("%s:5:7\n%s:5:7\n" % (BLOCKED.hex(), ALLOWED.hex())) + handle.write("%s:%d:7\n%s:%d:7\n" % (BLOCKED.hex(), touched, ALLOWED.hex(), touched)) restarted = Tracker(self.config, self.files, extra_args=["-l", path]) try: -- cgit v1.3