mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-13 16:29:51 +00:00
Move time formatter tests
UploadResultsRendererMixin no longer has render_time(); moving tests for render_time() as tests for abbreviate_time() to a more appropriate place.
This commit is contained in:
parent
9c14eec1e0
commit
4b560d10cc
@ -23,6 +23,16 @@ class Util(ShouldFailMixin, testutil.ReallyEqualMixin, unittest.TestCase):
|
|||||||
self.failUnlessReallyEqual(common.abbreviate_time(0.000123), "123us")
|
self.failUnlessReallyEqual(common.abbreviate_time(0.000123), "123us")
|
||||||
self.failUnlessReallyEqual(common.abbreviate_time(-123000), "-123000000000us")
|
self.failUnlessReallyEqual(common.abbreviate_time(-123000), "-123000000000us")
|
||||||
|
|
||||||
|
self.failUnlessReallyEqual(common.abbreviate_time(None), "")
|
||||||
|
self.failUnlessReallyEqual(common.abbreviate_time(2.5), "2.50s")
|
||||||
|
self.failUnlessReallyEqual(common.abbreviate_time(0.25), "250ms")
|
||||||
|
self.failUnlessReallyEqual(common.abbreviate_time(0.0021), "2.1ms")
|
||||||
|
self.failUnlessReallyEqual(common.abbreviate_time(0.000123), "123us")
|
||||||
|
self.failUnlessReallyEqual(common.abbreviate_rate(None), "")
|
||||||
|
self.failUnlessReallyEqual(common.abbreviate_rate(2500000), "2.50MBps")
|
||||||
|
self.failUnlessReallyEqual(common.abbreviate_rate(30100), "30.1kBps")
|
||||||
|
self.failUnlessReallyEqual(common.abbreviate_rate(123), "123Bps")
|
||||||
|
|
||||||
def test_compute_rate(self):
|
def test_compute_rate(self):
|
||||||
self.failUnlessReallyEqual(common.compute_rate(None, None), None)
|
self.failUnlessReallyEqual(common.compute_rate(None, None), None)
|
||||||
self.failUnlessReallyEqual(common.compute_rate(None, 1), None)
|
self.failUnlessReallyEqual(common.compute_rate(None, 1), None)
|
||||||
|
@ -1052,17 +1052,6 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
|||||||
self.failUnlessReallyEqual(drrm.render_rate(None, 30100), "30.1kBps")
|
self.failUnlessReallyEqual(drrm.render_rate(None, 30100), "30.1kBps")
|
||||||
self.failUnlessReallyEqual(drrm.render_rate(None, 123), "123Bps")
|
self.failUnlessReallyEqual(drrm.render_rate(None, 123), "123Bps")
|
||||||
|
|
||||||
urrm = status.UploadResultsRendererMixin()
|
|
||||||
self.failUnlessReallyEqual(urrm.render_time(None, None), "")
|
|
||||||
self.failUnlessReallyEqual(urrm.render_time(None, 2.5), "2.50s")
|
|
||||||
self.failUnlessReallyEqual(urrm.render_time(None, 0.25), "250ms")
|
|
||||||
self.failUnlessReallyEqual(urrm.render_time(None, 0.0021), "2.1ms")
|
|
||||||
self.failUnlessReallyEqual(urrm.render_time(None, 0.000123), "123us")
|
|
||||||
self.failUnlessReallyEqual(urrm.render_rate(None, None), "")
|
|
||||||
self.failUnlessReallyEqual(urrm.render_rate(None, 2500000), "2.50MBps")
|
|
||||||
self.failUnlessReallyEqual(urrm.render_rate(None, 30100), "30.1kBps")
|
|
||||||
self.failUnlessReallyEqual(urrm.render_rate(None, 123), "123Bps")
|
|
||||||
|
|
||||||
def test_GET_FILEURL(self):
|
def test_GET_FILEURL(self):
|
||||||
d = self.GET(self.public_url + "/foo/bar.txt")
|
d = self.GET(self.public_url + "/foo/bar.txt")
|
||||||
d.addCallback(self.failUnlessIsBarDotTxt)
|
d.addCallback(self.failUnlessIsBarDotTxt)
|
||||||
|
Loading…
Reference in New Issue
Block a user