From 3ecb483e35977aa1bb440ce03db203b3a859442c Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 3 Mar 2008 21:37:17 -0700 Subject: [PATCH] test_system: add test coverage for download-status and upload-status --- src/allmydata/test/test_system.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/allmydata/test/test_system.py b/src/allmydata/test/test_system.py index 0ce85d75..8c6658a6 100644 --- a/src/allmydata/test/test_system.py +++ b/src/allmydata/test/test_system.py @@ -1172,6 +1172,22 @@ class SystemTest(testutil.SignalMixin, testutil.PollMixin, unittest.TestCase): # check that the status page exists d.addCallback(lambda res: self.GET("status", followRedirect=True)) + def _got_status(res): + # find an interesting upload and download to look at. LIT files + # are not interesting. + for dl in self.clients[0].list_recent_downloads(): + if dl.get_size() > 200: + self._down_status = dl.get_counter() + for ul in self.clients[0].list_recent_uploads(): + if ul.get_size() > 200: + self._up_status = ul.get_counter() + + # and that there are some upload- and download- status pages + return self.GET("status/up-%d" % self._up_status) + d.addCallback(_got_status) + def _got_up(res): + return self.GET("status/down-%d" % self._down_status) + d.addCallback(_got_up) # TODO: mangle the second segment of a file, to test errors that # occur after we've already sent some good data, which uses a -- 2.45.2