summaryrefslogtreecommitdiff
path: root/tests/integration/test_fullscrape.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/test_fullscrape.py')
-rw-r--r--tests/integration/test_fullscrape.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/integration/test_fullscrape.py b/tests/integration/test_fullscrape.py
index be7b502..3150612 100644
--- a/tests/integration/test_fullscrape.py
+++ b/tests/integration/test_fullscrape.py
@@ -78,13 +78,15 @@ class FullScrape(TrackerTestCase):
78 escaped = line.rsplit(b":", 2)[0] 78 escaped = line.rsplit(b":", 2)[0]
79 self.assertIn(b"%", escaped, "these hashes are mostly unprintable bytes") 79 self.assertIn(b"%", escaped, "these hashes are mostly unprintable bytes")
80 80
81 def test_the_state_dump_carries_a_base_time_rather_than_a_peer_count(self): 81 def test_the_state_dump_carries_an_age_rather_than_a_peer_count(self):
82 """What a restart reads back, so its second column is the torrent's 82 """What a restart reads back. The second column is how many minutes
83 own clock and not a count of anybody.""" 83 ago the torrent was last touched, not a stamp and not a count of
84 anybody: the clock counts from boot, so an absolute time would mean
85 nothing to the process that reads it."""
84 entries = self.entries_from_lines(self.scrape_all("/stats?mode=statedump")) 86 entries = self.entries_from_lines(self.scrape_all("/stats?mode=statedump"))
85 self.assertIn(self.seeding.hex().upper().encode(), entries) 87 self.assertIn(self.seeding.hex().upper().encode(), entries)
86 base, completed = entries[self.seeding.hex().upper().encode()] 88 age, completed = entries[self.seeding.hex().upper().encode()]
87 self.assertGreater(int(base), 0) 89 self.assertEqual(int(age), 0, "announced a moment ago")
88 self.assertEqual(int(completed), 0) 90 self.assertEqual(int(completed), 0)
89 91
90 # ------------------------------------------------------------ shape 92 # ------------------------------------------------------------ shape