1
0
mirror of https://github.com/wting/autojump synced 2026-03-02 03:49:26 +00:00

break db load into smaller functions, load backup if opening primary db fails

This commit is contained in:
William Ting
2012-05-28 09:44:09 -10:00
parent 626fa8b080
commit 05026ff54e
2 changed files with 46 additions and 31 deletions

View File

@@ -91,7 +91,7 @@ class TestAutojump(unittest.TestCase):
os.remove(fname)
os.remove(fname + '.bak')
def test_db_load_migrate(self):
def test_db_migration(self):
ORIG_CONFIG_DIR = autojump.CONFIG_DIR
try:
# setup
@@ -101,8 +101,8 @@ class TestAutojump(unittest.TestCase):
fname = CONFIG_DIR + '/autojump_py'
db = autojump.Database(fname)
db.add('/1')
shutil.copy(fname, fname + '.bak')
db.add('/2')
shutil.copy(fname, fname + '.bak')
# test
missing_fname = '/tmp/autojump_test_db_load_missing_' + str(random.randint(0,32678)) + '.txt'