From 1c356825832e549570c690a170a84270022578e5 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 28 Nov 2026 16:27:46 +0100 Subject: Parser now rejects negative port numbers --- tests/integration/test_announce.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/integration/test_announce.py') diff --git a/tests/integration/test_announce.py b/tests/integration/test_announce.py index ffbc07b..0eee0fe 100644 --- a/tests/integration/test_announce.py +++ b/tests/integration/test_announce.py @@ -118,6 +118,9 @@ class AnnounceRejects(TrackerTestCase): def test_a_port_out_of_range_is_rejected(self): self.assert_rejected("info_hash=" + "a" * 20 + "&peer_id=" + "b" * 20 + "&port=65536&left=0") + def test_a_negative_port_is_rejected(self): + self.assert_rejected("info_hash=" + "a" * 20 + "&peer_id=" + "b" * 20 + "&port=-1&left=0") + def test_a_port_that_is_not_a_number_is_rejected(self): self.assert_rejected("info_hash=" + "a" * 20 + "&peer_id=" + "b" * 20 + "&port=abc&left=0") -- cgit v1.3