From 4a46e91192fb3d159593cd04e224f37c22518015 Mon Sep 17 00:00:00 2001 From: Brian Warner <warner@lothar.com> Date: Thu, 2 Jul 2009 17:54:50 -0700 Subject: [PATCH] test_client.py: minor refactoring of BASECONFIG usage --- src/allmydata/test/test_client.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/allmydata/test/test_client.py b/src/allmydata/test/test_client.py index 6040e250..b652fbab 100644 --- a/src/allmydata/test/test_client.py +++ b/src/allmydata/test/test_client.py @@ -21,6 +21,10 @@ class FakeIntroducerClient(IntroducerClient): def remove_all_peers(self): self._connections.clear() +BASECONFIG = ("[client]\n" + "introducer.furl = \n" + ) + class Basic(unittest.TestCase): def test_loadable(self): basedir = "test_client.Basic.test_loadable" @@ -75,15 +79,11 @@ class Basic(unittest.TestCase): cancel_secret = c.get_cancel_secret() self.failUnless(base32.b2a(cancel_secret)) - BASECONFIG = ("[client]\n" - "introducer.furl = \n" - ) - def test_reserved_1(self): basedir = "client.Basic.test_reserved_1" os.mkdir(basedir) f = open(os.path.join(basedir, "tahoe.cfg"), "w") - f.write(self.BASECONFIG) + f.write(BASECONFIG) f.write("[storage]\n") f.write("enabled = true\n") f.write("reserved_space = 1000\n") @@ -95,7 +95,7 @@ class Basic(unittest.TestCase): basedir = "client.Basic.test_reserved_2" os.mkdir(basedir) f = open(os.path.join(basedir, "tahoe.cfg"), "w") - f.write(self.BASECONFIG) + f.write(BASECONFIG) f.write("[storage]\n") f.write("enabled = true\n") f.write("reserved_space = 10K\n") @@ -107,7 +107,7 @@ class Basic(unittest.TestCase): basedir = "client.Basic.test_reserved_3" os.mkdir(basedir) f = open(os.path.join(basedir, "tahoe.cfg"), "w") - f.write(self.BASECONFIG) + f.write(BASECONFIG) f.write("[storage]\n") f.write("enabled = true\n") f.write("reserved_space = 5mB\n") @@ -120,7 +120,7 @@ class Basic(unittest.TestCase): basedir = "client.Basic.test_reserved_4" os.mkdir(basedir) f = open(os.path.join(basedir, "tahoe.cfg"), "w") - f.write(self.BASECONFIG) + f.write(BASECONFIG) f.write("[storage]\n") f.write("enabled = true\n") f.write("reserved_space = 78Gb\n") @@ -133,7 +133,7 @@ class Basic(unittest.TestCase): basedir = "client.Basic.test_reserved_bad" os.mkdir(basedir) f = open(os.path.join(basedir, "tahoe.cfg"), "w") - f.write(self.BASECONFIG) + f.write(BASECONFIG) f.write("[storage]\n") f.write("enabled = true\n") f.write("reserved_space = bogus\n") -- 2.45.2