Example #1
0
    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())
Example #2
0
    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())
Example #3
0
 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()
Example #4
0
 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()
Example #5
0
 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
Example #6
0
    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')
Example #7
0
    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')
Example #8
0
 def testHistoryEnvVar(self):
     path = "foo"
     os.environ["YOKADI_HISTORY"] = path
     self.assertEqual(basepaths.getHistoryPath(), path)
Example #9
0
 def testHistoryEnvVar(self):
     path = "foo"
     os.environ["YOKADI_HISTORY"] = path
     self.assertEqual(basepaths.getHistoryPath(), path)