mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 05:28:04 +00:00
keep clientdir for now, improve how we access it
This commit is contained in:
parent
2937c729e3
commit
4d7f8ec9dd
@ -193,8 +193,7 @@ class Backup(GridTestMixin, CLITestMixin, StallMixin, unittest.TestCase):
|
||||
# sneak into the backupdb, crank back the "last checked"
|
||||
# timestamp to force a check on all files
|
||||
def _reset_last_checked(res):
|
||||
dbfile = os.path.join(self.get_clientdir(),
|
||||
"private", "backupdb.sqlite")
|
||||
dbfile = self.get_client_config().get_private_path("backupdb.sqlite")
|
||||
self.failUnless(os.path.exists(dbfile), dbfile)
|
||||
bdb = backupdb.get_backupdb(dbfile)
|
||||
bdb.cursor.execute("UPDATE last_upload SET last_checked=0")
|
||||
|
@ -400,6 +400,11 @@ class GridTestMixin:
|
||||
def get_client_config(self, i=0):
|
||||
return self.g.clients[i].config
|
||||
|
||||
def get_clientdir(self, i=0):
|
||||
# ideally, use something get_client_config() only, we
|
||||
# shouldn't need to manipulate raw paths..
|
||||
return self.get_client_config(i).get_config_path()
|
||||
|
||||
def get_client(self, i=0):
|
||||
return self.g.clients[i]
|
||||
|
||||
|
@ -13,9 +13,10 @@ class ConfigUtilTests(GridTestMixin, unittest.TestCase):
|
||||
def test_config_utils(self):
|
||||
self.basedir = "cli/ConfigUtilTests/test-config-utils"
|
||||
self.set_up_grid(oneshare=True)
|
||||
tahoe_cfg = os.path.join(self.get_clientdir(i=0), "tahoe.cfg")
|
||||
|
||||
# test that at least one option was read correctly
|
||||
config = self.get_client_config(i=0)
|
||||
config = configutil.get_config(tahoe_cfg)
|
||||
self.failUnlessEqual(config.get("node", "nickname"), "client-0")
|
||||
|
||||
# test that set_config can mutate an existing option
|
||||
|
Loading…
Reference in New Issue
Block a user