Esempio n. 1
0
    def testHaltOnError(self):
        """Tests that providing the --halt flag triggers HALT_ON_ERROR"""
        self.assertFalse(cdl_convert.config.HALT_ON_ERROR)

        sys.argv = ['scriptname', 'inputFile', '--halt']

        main.parse_args()

        self.assertTrue(cdl_convert.config.HALT_ON_ERROR)

        cdl_convert.config.HALT_ON_ERROR = False
Esempio n. 2
0
    def testHaltOnError(self):
        """Tests that providing the --halt flag triggers HALT_ON_ERROR"""
        self.assertFalse(
            cdl_convert.config.HALT_ON_ERROR
        )

        sys.argv = ['scriptname', 'inputFile', '--halt']

        main.parse_args()

        self.assertTrue(
            cdl_convert.config.HALT_ON_ERROR
        )

        cdl_convert.config.HALT_ON_ERROR = False
Esempio n. 3
0
    def testSingle(self):
        """Tests that the single fileout --single flag is caught"""

        sys.argv = ['scriptname', 'inputFile', '--single']

        args = main.parse_args()

        self.assertTrue(args.single)
Esempio n. 4
0
    def testMultipleGoodOutputFormat(self):
        """Tests that multiple good output formats are accepted and lowered"""

        sys.argv = ['scriptname', 'inputFile', '-o', 'CDL,CC']

        args = main.parse_args()

        self.assertEqual(['cdl', 'cc'], args.output)
Esempio n. 5
0
    def testNoProvidedOutput(self):
        """Tests that no provided output format is defaulted to cc"""

        sys.argv = ['scriptname', 'inputFile']

        args = main.parse_args()

        self.assertEqual(['cc'], args.output)
Esempio n. 6
0
    def testGoodInputFormat(self):
        """Tests that a good input format is accepted and lowered"""

        sys.argv = ['scriptname', 'inputFile', '-i', 'ALE']

        args = main.parse_args()

        self.assertEqual('ale', args.input)
Esempio n. 7
0
    def testGoodOutputFormat(self):
        """Tests that a good output format is accepted and lowered"""

        sys.argv = ['scriptname', 'inputFile', '-o', 'CDL']

        args = main.parse_args()

        self.assertEqual(['cdl'], args.output)
Esempio n. 8
0
    def testInputPositionalArg(self):
        """Tests that the input arg is positionally gotten correctly"""

        sys.argv = ['scriptname', 'inputFile.txt']

        args = main.parse_args()

        self.assertEqual('inputFile.txt', args.input_file)
Esempio n. 9
0
    def testNoDestination(self):
        """Tests that no destination defaults to ./converted"""

        sys.argv = ['scriptname', 'inputFile']

        args = main.parse_args()

        self.assertEqual('./converted/', args.destination)
Esempio n. 10
0
    def testCustomDestination(self):
        """Tests that destination flag works"""

        sys.argv = ['scriptname', 'inputFile', '-d', '/best/folder/']

        args = main.parse_args()

        self.assertEqual('/best/folder/', args.destination)
Esempio n. 11
0
    def testNoOutput(self):
        """Tests that --no-output was picked up correctly"""

        sys.argv = ['scriptname', 'inputFile', '--no-output']

        args = main.parse_args()

        self.assertTrue(args.no_output)
Esempio n. 12
0
    def testSanityCheck(self):
        """Tests the sanity check --check flag to be set"""

        sys.argv = ['scriptname', 'inputFile', '--check']

        args = main.parse_args()

        self.assertTrue(args.check)
Esempio n. 13
0
    def testNoOutput(self):
        """Tests that --no-output was picked up correctly"""

        sys.argv = ['scriptname', 'inputFile', '--no-output']

        args = main.parse_args()

        self.assertTrue(
            args.no_output
        )
Esempio n. 14
0
    def testSanityCheck(self):
        """Tests the sanity check --check flag to be set"""

        sys.argv = ['scriptname', 'inputFile', '--check']

        args = main.parse_args()

        self.assertTrue(
            args.check
        )
Esempio n. 15
0
    def testSingle(self):
        """Tests that the single fileout --single flag is caught"""

        sys.argv = ['scriptname', 'inputFile', '--single']

        args = main.parse_args()

        self.assertTrue(
            args.single
        )
Esempio n. 16
0
    def testMultipleGoodOutputFormat(self):
        """Tests that multiple good output formats are accepted and lowered"""

        sys.argv = ['scriptname', 'inputFile', '-o', 'CDL,CC']

        args = cdl_convert.parse_args()

        self.assertEqual(
            ['cdl', 'cc'],
            args.output
        )
Esempio n. 17
0
    def testNoProvidedOutput(self):
        """Tests that no provided output format is defaulted to cc"""

        sys.argv = ['scriptname', 'inputFile']

        args = cdl_convert.parse_args()

        self.assertEqual(
            ['cc'],
            args.output
        )
Esempio n. 18
0
    def testGoodOutputFormat(self):
        """Tests that a good output format is accepted and lowered"""

        sys.argv = ['scriptname', 'inputFile', '-o', 'CDL']

        args = cdl_convert.parse_args()

        self.assertEqual(
            ['cdl'],
            args.output
        )
Esempio n. 19
0
    def testGoodInputFormat(self):
        """Tests that a good input format is accepted and lowered"""

        sys.argv = ['scriptname', 'inputFile', '-i', 'ALE']

        args = cdl_convert.parse_args()

        self.assertEqual(
            'ale',
            args.input
        )
Esempio n. 20
0
    def testInputPositionalArg(self):
        """Tests that the input arg is positionally gotten correctly"""

        sys.argv = ['scriptname', 'inputFile.txt']

        args = cdl_convert.parse_args()

        self.assertEqual(
            'inputFile.txt',
            args.input_file
        )
Esempio n. 21
0
    def testNoDestination(self):
        """Tests that no destination defaults to ./converted"""

        sys.argv = ['scriptname', 'inputFile']

        args = main.parse_args()

        self.assertEqual(
            './converted/',
            args.destination
        )
Esempio n. 22
0
    def testCustomDestination(self):
        """Tests that destination flag works"""

        sys.argv = ['scriptname', 'inputFile', '-d', '/best/folder/']

        args = main.parse_args()

        self.assertEqual(
            '/best/folder/',
            args.destination
        )