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 testVersion_02 (self): cl = CommandLine () cl.parseParams (["-v"]) self.assertTrue (cl.version)
def testReadOnly_02 (self): cl = CommandLine () cl.parseParams (["-r"]) self.assertTrue (cl.readonly)
def testHelp_02 (self): cl = CommandLine () cl.parseParams (["--help"]) self.assertTrue (cl.help)
def testSingle (self): path = "/tmp/wikipath" cl = CommandLine () cl.parseParams ([path]) self.assertEqual (cl.wikipath, path)
def test_PageId_03(self): cl = CommandLine() cl.parseParams([]) self.assertIsNone(cl.page_id)
def test_PageId_02(self): cl = CommandLine() cl.parseParams(['-p', 'Page 1']) self.assertEqual(cl.page_id, u'Page 1')
def test_Version_01(self): cl = CommandLine() cl.parseParams(['--version']) self.assertTrue(cl.version)
def test_ReadOnly_01(self): cl = CommandLine() cl.parseParams(['--readonly']) self.assertTrue(cl.readonly)
def test_Help_01(self): cl = CommandLine() cl.parseParams(['-h']) self.assertTrue(cl.help)