From 8eb7ddab6b7f20fa73fb7a31f9ddf11128e1b2fa Mon Sep 17 00:00:00 2001 From: kevan Date: Sun, 19 Jul 2009 20:47:05 -0700 Subject: [PATCH] Add tests for parse_replace_arg() --- src/allmydata/test/test_web.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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") -- 2.45.2