diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-27 03:24:12 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-27 03:24:12 +0100 |
| commit | 06b7c31e25ea355946814da03749ae197c68d969 (patch) | |
| tree | 26b571432ed361f18ceccec6a17dead73075c7a0 /tests/integration/test_stats.py | |
| parent | 8c22d577fe1bf1f5c66c82c32854bdcd9ed1b3ee (diff) | |
Fix some tests to match retired stats modes and wrong config file ordering
Diffstat (limited to 'tests/integration/test_stats.py')
| -rw-r--r-- | tests/integration/test_stats.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/integration/test_stats.py b/tests/integration/test_stats.py index 7ff9a38..820b917 100644 --- a/tests/integration/test_stats.py +++ b/tests/integration/test_stats.py | |||
| @@ -16,8 +16,7 @@ from harness import TrackerTestCase | |||
| 16 | 16 | ||
| 17 | # The modes a default build answers. "tpbs" and "statedump" are full scrapes | 17 | # The modes a default build answers. "tpbs" and "statedump" are full scrapes |
| 18 | # and belong to test_fullscrape; "fulllog" and "woodpeckers" sit behind | 18 | # and belong to test_fullscrape; "fulllog" and "woodpeckers" sit behind |
| 19 | # feature flags this build does not set; "busy" is advertised but unbuilt, | 19 | # feature flags this build does not set. |
| 20 | # which the next case pins. | ||
| 21 | MRTG_MODES = ["peer", "conn", "scrp", "udp4", "tcp4", "torr", "fscr", "completed", "syncs"] | 20 | MRTG_MODES = ["peer", "conn", "scrp", "udp4", "tcp4", "torr", "fscr", "completed", "syncs"] |
| 22 | TEXT_MODES = ["herr", "s24s", "top10", "top100", "renew", "version"] | 21 | TEXT_MODES = ["herr", "s24s", "top10", "top100", "renew", "version"] |
| 23 | 22 | ||
| @@ -36,14 +35,14 @@ class StatsShape(TrackerTestCase): | |||
| 36 | for line in lines[:2]: | 35 | for line in lines[:2]: |
| 37 | self.assertRegex(line, rb"^\d+$", "mode %s line %r" % (mode, line)) | 36 | self.assertRegex(line, rb"^\d+$", "mode %s line %r" % (mode, line)) |
| 38 | 37 | ||
| 39 | def test_the_busy_mode_is_advertised_but_not_built(self): | 38 | def test_the_busy_mode_is_gone(self): |
| 40 | """TASK_STATS_BUSY_NETWORKS is in the enum and in the mode table, and | 39 | """It was listed in the mode table and implemented nowhere, so it only |
| 41 | no switch anywhere handles it, so the worker frees the empty answer | 40 | ever answered 500. Removed rather than written: picking poisoning |
| 42 | and the request ends as a server error. Pinned rather than blessed: | 41 | networks out stopped being meaningful once consumer lines became bot |
| 43 | either the report gets written or the mode leaves the table.""" | 42 | hosts and v6 made the address space too large to watch.""" |
| 44 | with self.assertRaises(urllib.error.HTTPError) as caught: | 43 | with self.assertRaises(urllib.error.HTTPError) as caught: |
| 45 | self.tracker.stats("busy") | 44 | self.tracker.stats("busy") |
| 46 | self.assertEqual(caught.exception.code, 500) | 45 | self.assertEqual(caught.exception.code, 400, "an unknown mode, like any other") |
| 47 | 46 | ||
| 48 | def test_an_unknown_mode_is_refused(self): | 47 | def test_an_unknown_mode_is_refused(self): |
| 49 | with self.assertRaises(urllib.error.HTTPError) as caught: | 48 | with self.assertRaises(urllib.error.HTTPError) as caught: |
