Exemple #1
0
    def test_main(self):
        args = ['prog_name', '-c', './testdata/test.conf']
        self.assertIsNone(AvivoreMain.main(args, True))

        args = ['prog_name', '-d', './testdata/test.db']
        self.assertIsNone(AvivoreMain.main(args, True))

        args = ['prog_name', '-e', './testdata/test.conf']
        self.assertIs(AvivoreMain.main(args, True), -1)
Exemple #2
0
    def test_main(self):
        args = [
            'prog_name',
            '-c',
            './testdata/test.conf'
        ]
        self.assertIsNone(AvivoreMain.main(args, True))

        args = [
            'prog_name',
            '-d',
            './testdata/test.db'
        ]
        self.assertIsNone(AvivoreMain.main(args, True))

        args = [
            'prog_name',
            '-e',
            './testdata/test.conf'
        ]
        self.assertIs(AvivoreMain.main(args, True), -1)
Exemple #3
0
    def test_check_usage(self):
        args = [
            'prog_name',
            '-c',
            'config_file',
        ]
        self.assertIsNone(AvivoreMain.check_usage(args))

        args = [
            'prog_name',
            '-d',
            'config_database',
        ]
        self.assertIsNone(AvivoreMain.check_usage(args))

        args = [
            'prog_name',
            '-e',
            'config_file',
        ]
        with self.assertRaises(AvivoreError.AvivoreError):
            self.assertIsNone(AvivoreMain.check_usage(args))

        args = [
            'prog_name',
            '-c',
        ]
        with self.assertRaises(AvivoreError.AvivoreError):
            self.assertIsNone(AvivoreMain.check_usage(args))

        args = [
            'prog_name',
            '-c',
            'config_file',
            'too_much',
        ]
        with self.assertRaises(AvivoreError.AvivoreError):
            self.assertIsNone(AvivoreMain.check_usage(args))
Exemple #4
0
    def test_check_usage(self):
        args = [
            'prog_name',
            '-c',
            'config_file',
        ]
        self.assertIsNone(AvivoreMain.check_usage(args))

        args = [
            'prog_name',
            '-d',
            'config_database',
        ]
        self.assertIsNone(AvivoreMain.check_usage(args))

        args = [
            'prog_name',
            '-e',
            'config_file',
        ]
        with self.assertRaises(AvivoreError.AvivoreError):
            self.assertIsNone(AvivoreMain.check_usage(args))

        args = [
            'prog_name',
            '-c',
        ]
        with self.assertRaises(AvivoreError.AvivoreError):
            self.assertIsNone(AvivoreMain.check_usage(args))

        args = [
            'prog_name',
            '-c',
            'config_file',
            'too_much',
        ]
        with self.assertRaises(AvivoreError.AvivoreError):
            self.assertIsNone(AvivoreMain.check_usage(args))
Exemple #5
0
 def test_software_init_msg(self):
     self.assertIsNone(AvivoreMain.software_init_msg('1.2.3'))
Exemple #6
0
 def test_software_init_msg(self):
     self.assertIsNone(AvivoreMain.software_init_msg('1.2.3'))