def testMigrateOldHistory(self): old = Path(self.testHomeDir) / '.yokadi_history' new = Path(basepaths.getHistoryPath()) old.touch() basepaths.migrateOldHistory() self.assertFalse(old.exists()) self.assertTrue(new.exists())
def __init__(self): Cmd.__init__(self) TaskCmd.__init__(self) ProjectCmd.__init__(self) KeywordCmd.__init__(self) AliasCmd.__init__(self) ConfCmd.__init__(self) self.prompt = "yokadi> " self.historyPath = basepaths.getHistoryPath() self.loadHistory()
def __init__(self): Cmd.__init__(self) TaskCmd.__init__(self) ProjectCmd.__init__(self) KeywordCmd.__init__(self) AliasCmd.__init__(self) ConfCmd.__init__(self) self.prompt = "yokadi> " self.historyPath = basepaths.getHistoryPath() self.loadHistory() self.cryptoMgr = cryptutils.YokadiCryptoManager( ) # Load shared cryptographic manager
def testMigrateOldHistoryOverwriteNew(self): old = Path(self.testHomeDir) / '.yokadi_history' new = Path(basepaths.getHistoryPath()) with old.open('w') as f: f.write('old') new.parent.mkdir(parents=True) with new.open('w') as f: f.write('new') basepaths.migrateOldHistory() self.assertFalse(old.exists()) with new.open() as f: newData = f.read() self.assertEqual(newData, 'old')
def testHistoryEnvVar(self): path = "foo" os.environ["YOKADI_HISTORY"] = path self.assertEqual(basepaths.getHistoryPath(), path)