forked from coala/coala-bears
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSharpLintBearTest.py
29 lines (23 loc) · 1.06 KB
/
CSharpLintBearTest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
from queue import Queue
from shutil import which
from unittest.case import skipIf
from bears.c_languages.CSharpLintBear import CSharpLintBear
from coalib.testing.LocalBearTestHelper import LocalBearTestHelper
from coalib.settings.Section import Section
@skipIf(which('mcs') is None, 'mono mcs is not installed')
class CSharpLintBearTest(LocalBearTestHelper):
def setUp(self):
self.section = Section('test section')
self.uut = CSharpLintBear(self.section, Queue())
self.test_file1 = os.path.join(os.path.dirname(__file__),
'test_files',
'csharplint_test1.cs')
self.test_file2 = os.path.join(os.path.dirname(__file__),
'test_files',
'csharplint_test2.cs')
def test_run(self):
# Test a file with no issues
self.check_validity(self.uut, [], self.test_file1)
# Test a file with issues
self.check_validity(self.uut, [], self.test_file2, valid=False)