Exemple #1
0
 def testEmpty (self):
     cl = CommandLine ()
     cl.parseParams ([])
     self.assertEqual (cl.wikipath, None)
     self.assertFalse (cl.help)
     self.assertFalse (cl.readonly)
     self.assertFalse (cl.version)
Exemple #2
0
    def __parseCommandLine(self, args):
        cl = CommandLine()
        try:
            cl.parseParams(args)
        except CommandLineException:
            print(cl.format_help())
            raise StarterExit

        return cl
Exemple #3
0
    def testVersion_02 (self):
        cl = CommandLine ()
        cl.parseParams (["-v"])

        self.assertTrue (cl.version)
Exemple #4
0
    def testReadOnly_02 (self):
        cl = CommandLine ()
        cl.parseParams (["-r"])

        self.assertTrue (cl.readonly)
Exemple #5
0
 def testHelp_02 (self):
     cl = CommandLine ()
     cl.parseParams (["--help"])
     self.assertTrue (cl.help)
Exemple #6
0
    def testSingle (self):
        path = "/tmp/wikipath"

        cl = CommandLine ()
        cl.parseParams ([path])
        self.assertEqual (cl.wikipath, path)
Exemple #7
0
    def test_PageId_03(self):
        cl = CommandLine()
        cl.parseParams([])

        self.assertIsNone(cl.page_id)
Exemple #8
0
    def test_PageId_02(self):
        cl = CommandLine()
        cl.parseParams(['-p', 'Page 1'])

        self.assertEqual(cl.page_id, u'Page 1')
Exemple #9
0
    def test_Version_01(self):
        cl = CommandLine()
        cl.parseParams(['--version'])

        self.assertTrue(cl.version)
Exemple #10
0
    def test_ReadOnly_01(self):
        cl = CommandLine()
        cl.parseParams(['--readonly'])

        self.assertTrue(cl.readonly)
Exemple #11
0
 def test_Help_01(self):
     cl = CommandLine()
     cl.parseParams(['-h'])
     self.assertTrue(cl.help)
Exemple #12
0
    def test_PageId_03(self):
        cl = CommandLine()
        cl.parseParams([])

        self.assertIsNone(cl.page_id)
Exemple #13
0
    def test_PageId_02(self):
        cl = CommandLine()
        cl.parseParams(['-p', 'Page 1'])

        self.assertEqual(cl.page_id, u'Page 1')
Exemple #14
0
    def test_Version_01(self):
        cl = CommandLine()
        cl.parseParams(['--version'])

        self.assertTrue(cl.version)
Exemple #15
0
    def test_ReadOnly_01(self):
        cl = CommandLine()
        cl.parseParams(['--readonly'])

        self.assertTrue(cl.readonly)
Exemple #16
0
 def test_Help_01(self):
     cl = CommandLine()
     cl.parseParams(['-h'])
     self.assertTrue(cl.help)