From: Brian Warner <warner@allmydata.com>
Date: Wed, 29 Oct 2008 04:43:35 +0000 (-0700)
Subject: test_client.py: improve test coverage a bit
X-Git-Url: https://git.rkrishnan.org/specifications/-?a=commitdiff_plain;h=248033d78c06b4bd08319da27e5a923e3192378e;p=tahoe-lafs%2Ftahoe-lafs.git

test_client.py: improve test coverage a bit
---

diff --git a/src/allmydata/test/test_client.py b/src/allmydata/test/test_client.py
index 48db3b05..836cd74f 100644
--- a/src/allmydata/test/test_client.py
+++ b/src/allmydata/test/test_client.py
@@ -34,6 +34,33 @@ class Basic(unittest.TestCase):
         open(os.path.join(basedir, "introducer.furl"), "w").write("")
         c = client.Client(basedir)
 
+    def test_loadable_old_config_bits(self):
+        basedir = "test_client.Basic.test_loadable_old_config_bits"
+        os.mkdir(basedir)
+        open(os.path.join(basedir, "introducer.furl"), "w").write("")
+        open(os.path.join(basedir, "vdrive.furl"), "w").write("")
+        open(os.path.join(basedir, "no_storage"), "w").write("")
+        open(os.path.join(basedir, "readonly_storage"), "w").write("")
+        open(os.path.join(basedir, "debug_discard_storage"), "w").write("")
+        c = client.Client(basedir)
+        try:
+            c.getServiceNamed("storage")
+            self.fail("that was supposed to fail")
+        except KeyError:
+            pass
+
+    def test_loadable_old_storage_config_bits(self):
+        basedir = "test_client.Basic.test_loadable_old_storage_config_bits"
+        os.mkdir(basedir)
+        open(os.path.join(basedir, "introducer.furl"), "w").write("")
+        open(os.path.join(basedir, "vdrive.furl"), "w").write("")
+        open(os.path.join(basedir, "readonly_storage"), "w").write("")
+        open(os.path.join(basedir, "debug_discard_storage"), "w").write("")
+        c = client.Client(basedir)
+        s = c.getServiceNamed("storage")
+        self.failUnless(s.no_storage)
+        self.failUnless(s.readonly_storage)
+
     def test_secrets(self):
         basedir = "test_client.Basic.test_secrets"
         os.mkdir(basedir)