From 75e662cc4613d2d73272ebdec61455bd32545bc4 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 16 Jun 2008 17:52:13 -0700 Subject: [PATCH] test_storage: add coverage for readonly_storage --- src/allmydata/test/test_storage.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/allmydata/test/test_storage.py b/src/allmydata/test/test_storage.py index 89a9d51b..e6218435 100644 --- a/src/allmydata/test/test_storage.py +++ b/src/allmydata/test/test_storage.py @@ -489,6 +489,16 @@ class Server(unittest.TestCase): leases = list(ss.get_leases("si3")) self.failUnlessEqual(len(leases), 2) + def test_readonly(self): + workdir = self.workdir("test_readonly") + ss = StorageServer(workdir, readonly_storage=True) + ss.setServiceParent(self.sparent) + + canary = FakeCanary() + already,writers = self.allocate(ss, "vid", [0,1,2], 75) + self.failUnlessEqual(already, set()) + self.failUnlessEqual(writers, {}) + class MutableServer(unittest.TestCase): -- 2.45.2