Example #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
Example #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
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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
        )
Example #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
        )
Example #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
        )
    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
        )
    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
        )
    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
        )
    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
        )
    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
        )
Example #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
        )
Example #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
        )