summaryrefslogtreecommitdiff
path: root/tests/integration/test_stats.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/test_stats.py')
-rw-r--r--tests/integration/test_stats.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/integration/test_stats.py b/tests/integration/test_stats.py
index 7b778d3..74f6d47 100644
--- a/tests/integration/test_stats.py
+++ b/tests/integration/test_stats.py
@@ -18,7 +18,7 @@ from harness import TrackerTestCase
18# and belong to test_fullscrape; "woodpeckers" sits behind a 18# and belong to test_fullscrape; "woodpeckers" sits behind a
19# feature flag this build does not set. 19# feature flag this build does not set.
20MRTG_MODES = ["peer", "conn", "scrp", "udp4", "tcp4", "torr", "fscr", "completed", "syncs"] 20MRTG_MODES = ["peer", "conn", "scrp", "udp4", "tcp4", "torr", "fscr", "completed", "syncs"]
21TEXT_MODES = ["herr", "s24s", "top10", "top100", "renew", "version"] 21TEXT_MODES = ["herr", "s24s", "top10", "top100", "renew"]
22 22
23 23
24class StatsShape(TrackerTestCase): 24class StatsShape(TrackerTestCase):
@@ -55,10 +55,16 @@ class StatsShape(TrackerTestCase):
55 self.assertIsNotNone(root.find("torrents/count_mutex")) 55 self.assertIsNotNone(root.find("torrents/count_mutex"))
56 self.assertIsNotNone(root.find("connections/tcp/announce")) 56 self.assertIsNotNone(root.find("connections/tcp/announce"))
57 57
58 def test_version_names_the_release(self): 58 def test_the_version_mode_is_gone(self):
59 # A build from a checkout appends what git describe said, a build from 59 """Which build a tracker is and what went into it is of use to whoever
60 # a tarball has nothing to append, so the commit is optional here. 60 attacks it and to nobody else on the far end of a socket. It is
61 self.assertRegex(self.tracker.stats("version"), rb"^opentracker \d+\.\d+\.\d+( \(\S+\))?\n$") 61 reported by -v, to whoever already has the binary."""
62 with self.assertRaises(urllib.error.HTTPError) as caught:
63 self.tracker.stats("version")
64 self.assertEqual(caught.exception.code, 400, "an unknown mode, like any other")
65
66 def test_everything_does_not_name_the_build(self):
67 self.assertNotIn(b"opentracker 1", self.tracker.stats("everything"))
62 68
63 69
64class StatsCount(TrackerTestCase): 70class StatsCount(TrackerTestCase):