]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Add tests for parse_replace_arg()
authorkevan <kevan@isnotajoke.com>
Mon, 20 Jul 2009 03:47:05 +0000 (20:47 -0700)
committerkevan <kevan@isnotajoke.com>
Mon, 20 Jul 2009 03:47:05 +0000 (20:47 -0700)
src/allmydata/test/test_web.py

index bc9005e0498635a0a8894aa21e587e9c70b126e9..28c0c9eb134bf27201b6be6a75297dc52d9d902e 100644 (file)
@@ -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")