forked from coala/coala-bears
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VHDLLintBear: Remove use of generic no cover
Add test to check for prerequisites Closes coala#2775
- Loading branch information
1 parent
d9a3d63
commit cf4af5b
Showing
2 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
from unittest import TestCase, mock | ||
|
||
from bears.vhdl.VHDLLintBear import VHDLLintBear | ||
from coalib.testing.LocalBearTestHelper import verify_local_bear | ||
|
||
|
||
VHDLLintBearTest = verify_local_bear(VHDLLintBear, | ||
('test',), | ||
('\t',)) | ||
class VHDLLintBearPrerequisiteTest(TestCase): | ||
def test_check_prerequisites(self): | ||
with mock.patch('bears.vhdl.VHDLLintBear.which') as mock_which: | ||
mock_which.side_effect = [None] | ||
self.assertEqual(VHDLLintBear.check_prerequisites(), | ||
'perl is not installed.') | ||
|
||
mock_which.side_effect = ['path/to/perl', None] | ||
self.assertEqual(VHDLLintBear.check_prerequisites(), | ||
'bakalint is missing. Download it from ' | ||
'<http://fpgalibre.sourceforge.net/' | ||
'ingles.html#tp46> and put it into your PATH.') | ||
|
||
mock_which.side_effect = ['path/to/perl', 'path/to/bakalint'] | ||
self.assertEqual(VHDLLintBear.check_prerequisites(), True) | ||
|
||
|
||
VHDLLintBearTest = verify_local_bear(VHDLLintBear, ('test',), ('\t',)) |