Coverage for test/tests/unit/test_output.py: 0.00%

1"""

2 tests the configuration

3"""

4 import pytest

5

6 from pytest_vulture.vulture.output_line import VultureOutputLine

7

8

9@pytest.mark.incremental

10 class TestVultureLine:

11 """

12 Tests VultureOutputLine

13 """

14 ___vulture_line: VultureOutputLine

15

16 @pytest.fixture(autouse=True)

17 def mock_response(self):

18 """

19 Get the mocked class

20 """

21 self.___vulture_line = VultureOutputLine(

22 "src/test.py:15: unused function 'main' (60% confidence)"

23 )

24

25 def test_message(self):

26 """

27 Tests VultureOutputLine.message

28 """

29 assert self.___vulture_line.message == "line 15 : unused function 'main' (60% confidence)"

30 self.___vulture_line = VultureOutputLine(

31 "src/test.py unused function 'main' (60% confidence)"

32 )

33 assert self.___vulture_line.message == "src/test.py unused function 'main' (60% confidence)"

34

35 def test_path(self):

36 """

37 Tests VultureOutputLine.path

38 """

39 assert self.___vulture_line.path.as_posix() == "src/test.py"

40

41 def test_line_number(self):

42 """

43 Tests VultureOutputLine.line_number

44 """

45 assert self.___vulture_line.line_number == 15

46 self.___vulture_line = VultureOutputLine(

47 "src/test.py unused function 'main' (60% confidence)"

48 )

49 assert self.___vulture_line.line_number is None

50

51 def test_type(self):

52 """

53 Tests VultureOutputLine.type

54 """

55 assert self.___vulture_line.type == "function"

56 assert self.___vulture_line.type == "function"

57 self.___vulture_line = VultureOutputLine(

58 "src/test.py:15: error"

59 )

60 assert self.___vulture_line.type == ""

61

62 def test_python_path(self):

63 """

64 Tests VultureOutputLine.python_path

65 """

66 assert self.___vulture_line.python_path == "src.test:main"

67 assert self.___vulture_line.python_path == "src.test:main"

68 self.___vulture_line = VultureOutputLine(

69 "src/test.py:15: unused attribute 'main' (60% confidence)"

70 )

71 assert self.___vulture_line.python_path == "src.test"