From 99b7b7b8716778846b08945594f4c3d984ffc6aa Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 27 Oct 2026 03:22:35 +0100 Subject: Add test for the error packet when a hash is blacklisted (the part I forgot in last commit) --- tests/integration/test_accesslist.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/test_accesslist.py b/tests/integration/test_accesslist.py index e963bcc..41ff654 100644 --- a/tests/integration/test_accesslist.py +++ b/tests/integration/test_accesslist.py @@ -48,10 +48,10 @@ class Blacklist(TrackerTestCase): ) answer = self.tracker.udp_raw(request) self.assertIsNotNone(answer) - self.assertEqual(len(answer), 8, "header only, no interval or counts") - action, transaction = struct.unpack(">II", answer) - self.assertEqual(action, 1, "it still claims to be an announce") + action, transaction = struct.unpack(">II", answer[:8]) + self.assertEqual(action, 3, "action 3 is the error packet") self.assertEqual(transaction, 7) + self.assertIn(b"not authorized", answer[8:]) def test_a_blocked_hash_is_not_stored_when_it_arrives_over_udp(self): sock, connection_id = self.tracker.udp_connect() -- cgit v1.3