Completed
Pull Request — master (#1504)
by Abdeali
01:48
created

coalib.tests.coalaTest.test_find_no_issues()   A

Complexity

Conditions 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 10
rs 9.4285
1
import os
2
import re
3
import sys
4
import unittest
5
6
from coalib.tests.TestUtilities import execute_coala
7
from coalib.misc.ContextManagers import prepare_file
8
from coalib import coala
9
10
11
class coalaTest(unittest.TestCase):
12
13
    def setUp(self):
14
        self.old_argv = sys.argv
15
16
    def tearDown(self):
17
        sys.argv = self.old_argv
18
19
    def test_coala(self):
20
        with prepare_file(["#fixme"], None) as (lines, filename):
21
            bear = "LineCountBear"
22
            retval, output = execute_coala(
23
                             coala.main,
24
                            "coala", "-c", os.devnull,
25
                            "--settings", "files=" + re.escape(filename),
26
                            "bears=" + bear)
27
        self.assertIn("This file has 1 lines.",
28
                      output,
29
                      "The output should report count as 1 lines")
30