summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/test_stats.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/integration/test_stats.py b/tests/integration/test_stats.py
index 088d8a1..c4ac95a 100644
--- a/tests/integration/test_stats.py
+++ b/tests/integration/test_stats.py
@@ -177,6 +177,15 @@ class StatsNetworks(TrackerTestCase):
177 for line in lines: 177 for line in lines:
178 self.assertEqual(int(line.split(b":")[0]), 3, "three peers from the one network") 178 self.assertEqual(int(line.split(b":")[0]), 3, "three peers from the one network")
179 179
180 def test_the_report_survives_a_torrent_with_no_v4_peers(self):
181 # A torrent whose only peer is v6 has no v4 peer list once the lists
182 # are allocated on demand. The s24 report walks the v4 list of every
183 # torrent, so it has to skip the absent one rather than follow a null
184 # pointer. Needs WANT_IP_FROM_QUERY_STRING to force the family; without
185 # it the peer is loopback v4 and the walk is never asked to skip.
186 self.tracker.announce(self.hash_for("s24v6only"), ip="2001:db8::1", port=6001, left=0)
187 self.assertIn(b"Networks, limit /24:", self.tracker.stats("s24s"))
188
180 189
181if __name__ == "__main__": 190if __name__ == "__main__":
182 unittest.main() 191 unittest.main()