Skip to content

Commit

Permalink
AlexBear: Remove use of generic no cover
Browse files Browse the repository at this point in the history
Add test to check prerequisites

Closes coala#2771
  • Loading branch information
kx-chen committed Nov 24, 2018
1 parent 5374fb4 commit 3cceff2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bears/natural_language/AlexBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AlexBear:
@classmethod
def check_prerequisites(cls):
parent_prereqs = super().check_prerequisites()
if parent_prereqs is not True: # pragma: no cover
if parent_prereqs is not True:
return parent_prereqs

incorrect_pkg_msg = (
Expand Down
7 changes: 7 additions & 0 deletions tests/natural_language/AlexBearTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@ def test_right_alex_installed(self, check_output_mock):
b' Catch insensitive, inconsiderate writing\n'
b'Usage instructions and examples here ....')
self.assertTrue(AlexBear.check_prerequisites())

def test_check_prerequisites(self, check_output_mock):
with patch.object(AlexBear.__bases__[1],
'check_prerequisites') as mock_method:
mock_method.return_value = False
self.assertEqual(False,
AlexBear.check_prerequisites())

0 comments on commit 3cceff2

Please sign in to comment.