def testEmpty (self): cl = CommandLine () cl.parseParams ([]) self.assertEqual (cl.wikipath, None) self.assertFalse (cl.help) self.assertFalse (cl.readonly) self.assertFalse (cl.version)
def __parseCommandLine(self, args): cl = CommandLine() try: cl.parseParams(args) except CommandLineException: print(cl.format_help()) raise StarterExit return cl
def test_Version_01(self): cl = CommandLine() cl.parseParams(['--version']) self.assertTrue(cl.version)
def testReadOnly_02 (self): cl = CommandLine () cl.parseParams (["-r"]) self.assertTrue (cl.readonly)
def testVersion_02 (self): cl = CommandLine () cl.parseParams (["-v"]) self.assertTrue (cl.version)
def testOver (self): path = "/tmp/wikipath" cl = CommandLine () self.assertRaises (CommandLineException, cl.parseParams, [path, u"-abyrvalg"])
def testHelp_02 (self): cl = CommandLine () cl.parseParams (["--help"]) self.assertTrue (cl.help)
def test_PageId_03(self): cl = CommandLine() cl.parseParams([]) self.assertIsNone(cl.page_id)
def testSingle (self): path = "/tmp/wikipath" cl = CommandLine () cl.parseParams ([path]) self.assertEqual (cl.wikipath, path)
def test_Over(self): path = '/tmp/wikipath' cl = CommandLine() self.assertRaises(CommandLineException, cl.parseParams, [path, u'-abyrvalg'])
def test_PageId_02(self): cl = CommandLine() cl.parseParams(['-p', 'Page 1']) self.assertEqual(cl.page_id, u'Page 1')
def test_Help_01(self): cl = CommandLine() cl.parseParams(['-h']) self.assertTrue(cl.help)
def test_ReadOnly_01(self): cl = CommandLine() cl.parseParams(['--readonly']) self.assertTrue(cl.readonly)