示例#1
0
文件: main.py 项目: agateau/yokadi
 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()
示例#2
0
文件: main.py 项目: kotenev/yokadi
 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()
示例#3
0
文件: main.py 项目: semtle/yokadi
 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
示例#4
0
文件: main.py 项目: hswick/yokadi
 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 = os.getenv("YOKADI_HISTORY")
     if not self.historyPath:
         if os.name == "posix":
             self.historyPath = os.path.join(os.path.expandvars("$HOME"), ".yokadi_history")
         else:
             # Windows location
             self.historyPath = os.path.join(os.path.expandvars("$APPDATA"), ".yokadi_history")
     self.loadHistory()
     self.cryptoMgr = cryptutils.YokadiCryptoManager()  # Load shared cryptographic manager
示例#5
0
文件: main.py 项目: bport/yokadi
 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 = os.getenv("YOKADI_HISTORY")
     if not self.historyPath:
         if os.name == "posix":
             self.historyPath = os.path.join(os.path.expandvars("$HOME"),
                                             ".yokadi_history")
         else:
             # Windows location
             self.historyPath = os.path.join(os.path.expandvars("$APPDATA"),
                                             ".yokadi_history")
     self.loadHistory()
     self.cryptoMgr = cryptutils.YokadiCryptoManager(
     )  # Load shared cryptographic manager
示例#6
0
class ProjectTestCase(unittest.TestCase):
    def setUp(self):
        testutils.clearDatabase()
        tui.clearInputAnswers()
        self.cmd = ProjectCmd()

    def testAdd(self):
        tui.addInputAnswers("y")
        self.cmd.do_p_add("p1")

        tui.addInputAnswers("y", "y")
        self.cmd.do_p_add("p2 @kw1 @kw2=12")

        projects = list(Project.select())
        result = [x.name for x in projects]
        expected = [u"p1", u"p2"]
        self.assertEqual(result, expected)

        kwDict = Project.get(2).getKeywordDict()
        self.assertEqual(kwDict, dict(kw1=None, kw2=12))

    def testEdit(self):
        # Create project p1 and rename it to p2
        self.cmd.do_p_add("p1")
        project = Project.get(1)
        self.assertEqual(project.name, "p1")

        tui.addInputAnswers("p2")
        self.cmd.do_p_edit("p1")
        self.assertEqual(project.name, "p2")

        # Create project p3 and try to rename it to p2
        self.cmd.do_p_add("p3")
        project = Project.get(2)
        self.assertEqual(project.name, "p3")

        tui.addInputAnswers("p2")
        self.assertRaises(YokadiException, self.cmd.do_p_edit, "p3")
        self.assertEqual(project.name, "p3")
示例#7
0
 def setUp(self):
     testutils.clearDatabase()
     tui.clearInputAnswers()
     self.cmd = ProjectCmd()