Added sub-tests for a python2 input file.

This commit is contained in:
Andrew Hamilton 2016-02-09 21:59:54 +00:00
parent 7829bad0ec
commit 4752f0d735
13 changed files with 64 additions and 10 deletions

4
golden-files/input/hi.py Normal file
View file

@ -0,0 +1,4 @@
def hi():
print "hi"

View file

@ -0,0 +1,15 @@
import unittest
import hi
class HiTestCase(unittest.TestCase):
def test_hi(self):
hi.hi()
if __name__ == "__main__":
unittest.main()

View file

View file

@ -0,0 +1,12 @@
Help on module hi:
NAME
hi
FILE
/home/ahamilton/code/vigil/golden-files/input/hi.py
FUNCTIONS
hi()

View file

View file

@ -0,0 +1 @@
No config file found, using default configuration

View file

@ -0,0 +1,4 @@

> def hi():
> print "hi"

View file

@ -0,0 +1,2 @@
def hi():


View file

@ -0,0 +1 @@
("3:1: 'hi'", 2)

View file

@ -0,0 +1,4 @@
Name File
---- ----
m __main__ ./input/hi.py

View file

View file

@ -0,0 +1 @@
No tests.

View file

@ -68,37 +68,47 @@ class ToolsTestCase(unittest.TestCase):
self._sub_tests([(tools.contents, "hi3.py", tools.Status.normal)]) self._sub_tests([(tools.contents, "hi3.py", tools.Status.normal)])
def test_python_syntax(self): def test_python_syntax(self):
self._sub_tests([(tools.python_syntax, "hi3.py", tools.Status.ok)]) self._sub_tests([(tools.python_syntax, "hi3.py", tools.Status.ok),
(tools.python_syntax, "hi.py", tools.Status.ok)])
def test_unittests(self): def test_unittests(self):
self._sub_tests([ self._sub_tests([
(tools.python_unittests, "hi3.py", tools.Status.not_applicable)]) (tools.python_unittests, "hi3.py", tools.Status.not_applicable),
(tools.python_unittests, "hi.py", tools.Status.not_applicable)])
def test_pydoc(self): def test_pydoc(self):
self._sub_tests([(tools.pydoc, "hi3.py", tools.Status.normal)]) self._sub_tests([(tools.pydoc, "hi3.py", tools.Status.normal),
(tools.pydoc, "hi.py", tools.Status.normal)])
def test_python_coverage(self): def test_python_coverage(self):
self._sub_tests([ self._sub_tests([
(tools.python_coverage, "hi3.py", tools.Status.normal)]) (tools.python_coverage, "hi3.py", tools.Status.normal),
(tools.python_coverage, "hi.py", tools.Status.normal)])
def test_pep8(self): def test_pep8(self):
self._sub_tests([(tools.pep8, "hi3.py", tools.Status.ok)]) self._sub_tests([(tools.pep8, "hi3.py", tools.Status.ok),
(tools.pep8, "hi.py", tools.Status.ok)])
def test_pyflakes(self): def test_pyflakes(self):
self._sub_tests([(tools.pyflakes, "hi3.py", tools.Status.ok)]) self._sub_tests([(tools.pyflakes, "hi3.py", tools.Status.ok),
(tools.pyflakes, "hi.py", tools.Status.ok)])
def test_pylint(self): def test_pylint(self):
self._sub_tests([(tools.pylint, "hi3.py", tools.Status.ok)]) self._sub_tests([(tools.pylint, "hi3.py", tools.Status.ok),
(tools.pylint, "hi.py", tools.Status.ok)])
def test_python_gut(self): def test_python_gut(self):
self._sub_tests([(tools.python_gut, "hi3.py", tools.Status.normal)]) self._sub_tests([(tools.python_gut, "hi3.py", tools.Status.normal),
(tools.python_gut, "hi.py", tools.Status.normal)])
def test_python_modulefinder(self): def test_python_modulefinder(self):
self._sub_tests([ self._sub_tests([
(tools.python_modulefinder, "hi3.py", tools.Status.normal)]) (tools.python_modulefinder, "hi3.py", tools.Status.normal),
(tools.python_modulefinder, "hi.py", tools.Status.normal)])
def test_python_mccable(self): def test_python_mccable(self):
self._sub_tests([(tools.python_mccabe, "hi3.py", tools.Status.ok)]) self._sub_tests([(tools.python_mccabe, "hi3.py", tools.Status.ok),
(tools.python_mccabe, "hi.py", tools.Status.ok)])
def test_perl_syntax(self): def test_perl_syntax(self):
self._sub_tests([(tools.perl_syntax, "perl.pl", tools.Status.ok)]) self._sub_tests([(tools.perl_syntax, "perl.pl", tools.Status.ok)])