Drop unused ctx argument from render_space methods

This commit is contained in:
Sajith Sasidharan 2020-02-11 05:20:45 -05:00 committed by Sajith Sasidharan
parent d5af7c0d2e
commit dbc6b2afa0
2 changed files with 6 additions and 6 deletions

View File

@ -4223,9 +4223,9 @@ class WebStatus(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin):
def test_util(self):
w = StorageStatusElement(None, None)
self.failUnlessEqual(w.render_space(None, None), "?")
self.failUnlessEqual(w.render_space(None, 10e6), "10000000")
self.failUnlessEqual(w.render_abbrev_space(None, None), "?")
self.failUnlessEqual(w.render_abbrev_space(None, 10e6), "10.00 MB")
self.failUnlessEqual(w.render_space(None), "?")
self.failUnlessEqual(w.render_space(10e6), "10000000")
self.failUnlessEqual(w.render_abbrev_space(None), "?")
self.failUnlessEqual(w.render_abbrev_space(10e6), "10.00 MB")
self.failUnlessEqual(remove_prefix("foo.bar", "foo."), "bar")
self.failUnlessEqual(remove_prefix("foo.bar", "baz."), None)

View File

@ -50,12 +50,12 @@ class StorageStatusElement(Element):
return tag("?")
return tag(abbreviate_space(val))
def render_abbrev_space(self, ctx, size):
def render_abbrev_space(self, size):
if size is None:
return "?"
return abbreviate_space(size)
def render_space(self, ctx, size):
def render_space(self, size):
if size is None:
return "?"
return "%d" % size