def __init__(self): Cmd.__init__(self) TaskCmd.__init__(self) ProjectCmd.__init__(self) KeywordCmd.__init__(self) BugCmd.__init__(self) AliasCmd.__init__(self) self.prompt = "yokadi> " self.historyPath=os.path.expandvars("$HOME/.yokadi_history") 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 = 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()
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 setUp(self): testutils.clearDatabase() tui.clearInputAnswers() self.cmd = ProjectCmd()