Example #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)
Example #2
0
    def __parseCommandLine(self, args):
        cl = CommandLine()
        try:
            cl.parseParams(args)
        except CommandLineException:
            print(cl.format_help())
            raise StarterExit

        return cl
Example #3
0
    def test_Version_01(self):
        cl = CommandLine()
        cl.parseParams(['--version'])

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

        self.assertTrue (cl.readonly)
Example #5
0
    def testVersion_02 (self):
        cl = CommandLine ()
        cl.parseParams (["-v"])

        self.assertTrue (cl.version)
Example #6
0
    def testOver (self):
        path = "/tmp/wikipath"
        cl = CommandLine ()

        self.assertRaises (CommandLineException, cl.parseParams, [path, u"-abyrvalg"])
Example #7
0
 def testHelp_02 (self):
     cl = CommandLine ()
     cl.parseParams (["--help"])
     self.assertTrue (cl.help)
Example #8
0
    def test_PageId_03(self):
        cl = CommandLine()
        cl.parseParams([])

        self.assertIsNone(cl.page_id)
Example #9
0
    def testSingle (self):
        path = "/tmp/wikipath"

        cl = CommandLine ()
        cl.parseParams ([path])
        self.assertEqual (cl.wikipath, path)
Example #10
0
    def test_Over(self):
        path = '/tmp/wikipath'
        cl = CommandLine()

        self.assertRaises(CommandLineException, cl.parseParams,
                          [path, u'-abyrvalg'])
Example #11
0
    def test_PageId_02(self):
        cl = CommandLine()
        cl.parseParams(['-p', 'Page 1'])

        self.assertEqual(cl.page_id, u'Page 1')
Example #12
0
 def test_Help_01(self):
     cl = CommandLine()
     cl.parseParams(['-h'])
     self.assertTrue(cl.help)
Example #13
0
    def test_ReadOnly_01(self):
        cl = CommandLine()
        cl.parseParams(['--readonly'])

        self.assertTrue(cl.readonly)
Example #14
0
    def test_PageId_03(self):
        cl = CommandLine()
        cl.parseParams([])

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

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

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

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