-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
38 lines (28 loc) · 863 Bytes
/
Copy pathtest.py
File metadata and controls
38 lines (28 loc) · 863 Bytes
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
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
from reqlint import ReqLint
from glob import glob
class TestGood:
@staticmethod
def get_good_files():
return glob("test_data/good*.py")
def test(self):
for f in self.get_good_files():
print(f"{f}: ", end="")
with open(f, "r") as file:
code = file.read()
assert ReqLint.has_lint_errors(code) is False
print("Passed")
class TestBad:
@staticmethod
def get_bad_files():
return glob("test_data/bad*.py")
def test(self):
for f in self.get_bad_files():
print(f"{f}: ", end="")
with open(f, "r") as file:
code = file.read()
assert ReqLint.has_lint_errors(code) is True
print("Passed")
if __name__ == "__main__":
TestGood().test()
TestBad().test()