From: kevan Date: Mon, 20 Jul 2009 03:47:05 +0000 (-0700) Subject: Add tests for parse_replace_arg() X-Git-Tag: allmydata-tahoe-1.5.0~27 X-Git-Url: https://git.rkrishnan.org/pf/content/%22file:/frontends/provisioning?a=commitdiff_plain;h=8eb7ddab6b7f20fa73fb7a31f9ddf11128e1b2fa;p=tahoe-lafs%2Ftahoe-lafs.git Add tests for parse_replace_arg() --- diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index bc9005e0..28c0c9eb 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -2512,7 +2512,15 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, unittest.TestCase): return d -class Util(unittest.TestCase): +class Util(unittest.TestCase, ShouldFailMixin): + def test_parse_replace_arg(self): + self.failUnlessEqual(common.parse_replace_arg("true"), True) + self.failUnlessEqual(common.parse_replace_arg("false"), False) + self.failUnlessEqual(common.parse_replace_arg("only-files"), + "only-files") + self.shouldFail(AssertionError, "test_parse_replace_arg", "", + common.parse_replace_arg, "only_fles") + def test_abbreviate_time(self): self.failUnlessEqual(common.abbreviate_time(None), "") self.failUnlessEqual(common.abbreviate_time(1.234), "1.23s")