mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-02 11:16:41 +00:00
Drop unused ctx
argument from render_space methods
This commit is contained in:
parent
c7a63f957d
commit
0993e61046
@ -4210,9 +4210,9 @@ class WebStatus(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin):
|
|||||||
|
|
||||||
def test_util(self):
|
def test_util(self):
|
||||||
w = StorageStatusElement(None, None)
|
w = StorageStatusElement(None, None)
|
||||||
self.failUnlessEqual(w.render_space(None, None), "?")
|
self.failUnlessEqual(w.render_space(None), "?")
|
||||||
self.failUnlessEqual(w.render_space(None, 10e6), "10000000")
|
self.failUnlessEqual(w.render_space(10e6), "10000000")
|
||||||
self.failUnlessEqual(w.render_abbrev_space(None, None), "?")
|
self.failUnlessEqual(w.render_abbrev_space(None), "?")
|
||||||
self.failUnlessEqual(w.render_abbrev_space(None, 10e6), "10.00 MB")
|
self.failUnlessEqual(w.render_abbrev_space(10e6), "10.00 MB")
|
||||||
self.failUnlessEqual(remove_prefix("foo.bar", "foo."), "bar")
|
self.failUnlessEqual(remove_prefix("foo.bar", "foo."), "bar")
|
||||||
self.failUnlessEqual(remove_prefix("foo.bar", "baz."), None)
|
self.failUnlessEqual(remove_prefix("foo.bar", "baz."), None)
|
||||||
|
@ -50,12 +50,12 @@ class StorageStatusElement(Element):
|
|||||||
return tag("?")
|
return tag("?")
|
||||||
return tag(abbreviate_space(val))
|
return tag(abbreviate_space(val))
|
||||||
|
|
||||||
def render_abbrev_space(self, ctx, size):
|
def render_abbrev_space(self, size):
|
||||||
if size is None:
|
if size is None:
|
||||||
return "?"
|
return "?"
|
||||||
return abbreviate_space(size)
|
return abbreviate_space(size)
|
||||||
|
|
||||||
def render_space(self, ctx, size):
|
def render_space(self, size):
|
||||||
if size is None:
|
if size is None:
|
||||||
return "?"
|
return "?"
|
||||||
return "%d" % size
|
return "%d" % size
|
||||||
|
Loading…
Reference in New Issue
Block a user