mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 08:25:35 +00:00
add test coverage for the /stats web page
This commit is contained in:
parent
8c8bcb6d53
commit
a050204833
@ -1117,6 +1117,8 @@ class SystemTest(testutil.SignalMixin, testutil.PollMixin, unittest.TestCase):
|
||||
d.addCallback(lambda res: self.GET(public + "/subdir3/new.txt"))
|
||||
d.addCallback(self.failUnlessEqual, "NEWER contents")
|
||||
|
||||
# check that the status page exists
|
||||
d.addCallback(lambda res: self.GET("status"))
|
||||
|
||||
# TODO: mangle the second segment of a file, to test errors that
|
||||
# occur after we've already sent some good data, which uses a
|
||||
|
@ -5,7 +5,7 @@ from twisted.trial import unittest
|
||||
from twisted.internet import defer
|
||||
from twisted.web import client, error, http
|
||||
from twisted.python import failure, log
|
||||
from allmydata import interfaces, provisioning, uri, webish, upload
|
||||
from allmydata import interfaces, provisioning, uri, webish, upload, download
|
||||
from allmydata.util import fileutil
|
||||
from allmydata.test.common import NonGridDirectoryNode, FakeCHKFileNode, FakeMutableFileNode, create_chk_filenode
|
||||
from allmydata.interfaces import IURI, INewDirectoryURI, IReadonlyNewDirectoryURI, IFileURI, IMutableFileURI, IMutableFileNode
|
||||
@ -67,6 +67,11 @@ class FakeClient(service.MultiService):
|
||||
d.addCallback(_got_data)
|
||||
return d
|
||||
|
||||
def list_uploads(self):
|
||||
return [upload.UploadStatus()]
|
||||
def list_downloads(self):
|
||||
return [download.DownloadStatus()]
|
||||
|
||||
|
||||
class WebMixin(object):
|
||||
def setUp(self):
|
||||
@ -361,6 +366,13 @@ class Web(WebMixin, unittest.TestCase):
|
||||
d.addCallback(_check4)
|
||||
return d
|
||||
|
||||
def test_status(self):
|
||||
d = self.GET("/status")
|
||||
def _check(res):
|
||||
self.failUnless('Current Uploads and Downloads' in res)
|
||||
d.addCallback(_check)
|
||||
return d
|
||||
|
||||
def test_GET_FILEURL(self):
|
||||
d = self.GET(self.public_url + "/foo/bar.txt")
|
||||
d.addCallback(self.failUnlessIsBarDotTxt)
|
||||
|
Loading…
x
Reference in New Issue
Block a user