diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-27 03:22:35 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-27 03:22:35 +0100 |
| commit | 99b7b7b8716778846b08945594f4c3d984ffc6aa (patch) | |
| tree | f1e92d43a32cbf267ff3a136cb9114e18f7b019d /tests/integration/test_accesslist.py | |
| parent | bd7ce0fc81f9371fd4d09ea7fa1f05f32b39c15b (diff) | |
Add test for the error packet when a hash is blacklisted (the part I forgot in last commit)
Diffstat (limited to 'tests/integration/test_accesslist.py')
| -rw-r--r-- | tests/integration/test_accesslist.py | 6 |
1 files 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): | |||
| 48 | ) | 48 | ) |
| 49 | answer = self.tracker.udp_raw(request) | 49 | answer = self.tracker.udp_raw(request) |
| 50 | self.assertIsNotNone(answer) | 50 | self.assertIsNotNone(answer) |
| 51 | self.assertEqual(len(answer), 8, "header only, no interval or counts") | 51 | action, transaction = struct.unpack(">II", answer[:8]) |
| 52 | action, transaction = struct.unpack(">II", answer) | 52 | self.assertEqual(action, 3, "action 3 is the error packet") |
| 53 | self.assertEqual(action, 1, "it still claims to be an announce") | ||
| 54 | self.assertEqual(transaction, 7) | 53 | self.assertEqual(transaction, 7) |
| 54 | self.assertIn(b"not authorized", answer[8:]) | ||
| 55 | 55 | ||
| 56 | def test_a_blocked_hash_is_not_stored_when_it_arrives_over_udp(self): | 56 | def test_a_blocked_hash_is_not_stored_when_it_arrives_over_udp(self): |
| 57 | sock, connection_id = self.tracker.udp_connect() | 57 | sock, connection_id = self.tracker.udp_connect() |
