Exemplo n.º 1
0
    def test_parse_invalid_arg(self):

        # No coverage XML report specified
        invalid_argv = [[], ['--html-report', 'diff_cover.html']]

        for argv in invalid_argv:
            with self.assertRaises(SystemExit):
                print("args = {0}".format(argv))
                parse_coverage_args(argv)
Exemplo n.º 2
0
    def test_parse_invalid_arg(self):

        # No coverage XML report specified
        invalid_argv = [[], ['--html-report', 'diff_cover.html']]

        for argv in invalid_argv:
            with self.assertRaises(SystemExit):
                with nostderr():
                    parse_coverage_args(argv)
Exemplo n.º 3
0
    def test_parse_invalid_arg(self):

        # No coverage XML report specified
        invalid_argv = [[], ['--html-report', 'diff_cover.html']]

        for argv in invalid_argv:
            with self.assertRaises(SystemExit):
                print("args = {0}".format(argv))
                parse_coverage_args(argv)
Exemplo n.º 4
0
    def test_parse_invalid_arg(self):

        # No coverage XML report specified
        invalid_argv = [[], ['--html-report', 'diff_cover.html']]

        for argv in invalid_argv:
            with self.assertRaises(SystemExit):
                with nostderr():
                    parse_coverage_args(argv)
Exemplo n.º 5
0
    def test_parse_with_no_html_report(self):
        argv = ['reports/coverage.xml']

        arg_dict = parse_coverage_args(argv)
        self.assertEqual(arg_dict.get('coverage_xml'),
                         ['reports/coverage.xml'])
        self.assertEqual(arg_dict.get('ignore_unstaged'), False)
Exemplo n.º 6
0
    def test_parse_with_no_html_report(self):
        argv = ['reports/coverage.xml']

        arg_dict = parse_coverage_args(argv)
        self.assertEqual(
            arg_dict.get('coverage_xml'),
            ['reports/coverage.xml']
        )
Exemplo n.º 7
0
    def test_parse_with_exclude(self):
        argv = ['reports/coverage.xml']
        arg_dict = parse_coverage_args(argv)
        self.assertEqual(arg_dict.get('exclude'), None)

        argv = ['reports/coverage.xml', '--exclude', 'noneed/*.py']

        arg_dict = parse_coverage_args(argv)
        self.assertEqual(arg_dict.get('exclude'), ['noneed/*.py'])

        argv = [
            'reports/coverage.xml', '--exclude', 'noneed/*.py', 'other/**/*.py'
        ]

        arg_dict = parse_coverage_args(argv)
        self.assertEqual(arg_dict.get('exclude'),
                         ['noneed/*.py', 'other/**/*.py'])
Exemplo n.º 8
0
    def test_parse_with_html_report(self):
        argv = ['reports/coverage.xml', '--html-report', 'diff_cover.html']

        arg_dict = parse_coverage_args(argv)

        self.assertEqual(arg_dict.get('coverage_xml'),
                         ['reports/coverage.xml'])

        self.assertEqual(arg_dict.get('html_report'), 'diff_cover.html')
Exemplo n.º 9
0
    def test_parse_with_html_report(self):
        argv = ["reports/coverage.xml", "--html-report", "diff_cover.html"]

        arg_dict = parse_coverage_args(argv)

        self.assertEqual(arg_dict.get("coverage_xml"), ["reports/coverage.xml"])

        self.assertEqual(arg_dict.get("html_report"), "diff_cover.html")
        self.assertEqual(arg_dict.get("ignore_unstaged"), False)
Exemplo n.º 10
0
    def test_parse_with_html_report(self):
        argv = ['reports/coverage.xml',
                '--html-report', 'diff_cover.html']

        arg_dict = parse_coverage_args(argv)

        self.assertEqual(
            arg_dict.get('coverage_xml'),
            ['reports/coverage.xml']
        )

        self.assertEqual(
            arg_dict.get('html_report'),
            'diff_cover.html'
        )
Exemplo n.º 11
0
    def test_parse_with_ignored_unstaged(self):
        argv = ['reports/coverage.xml', '--ignore-unstaged']

        arg_dict = parse_coverage_args(argv)
        self.assertEqual(arg_dict.get('ignore_unstaged'), True)
Exemplo n.º 12
0
    def test_parse_with_ignored_unstaged(self):
        argv = ['reports/coverage.xml', '--ignore-unstaged']

        arg_dict = parse_coverage_args(argv)
        self.assertEqual(arg_dict.get('ignore_unstaged'), True)
Exemplo n.º 13
0
    def test_parse_with_ignored_unstaged(self):
        argv = ["reports/coverage.xml", "--ignore-unstaged"]

        arg_dict = parse_coverage_args(argv)
        self.assertEqual(arg_dict.get("ignore_unstaged"), True)