From 4752f0d7358549b2ff31d6ccfa18c2d16a0994fe Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Tue, 9 Feb 2016 21:59:54 +0000 Subject: [PATCH] Added sub-tests for a python2 input file. --- golden-files/input/hi.py | 4 +++ golden-files/input/hi_test.py | 15 ++++++++++ golden-files/results/pep8-hi_py | 0 golden-files/results/pydoc-hi_py | 12 ++++++++ golden-files/results/pyflakes-hi_py | 0 golden-files/results/pylint-hi_py | 1 + golden-files/results/python_coverage-hi_py | 4 +++ golden-files/results/python_gut-hi_py | 2 ++ golden-files/results/python_mccabe-hi_py | 1 + .../results/python_modulefinder-hi_py | 4 +++ golden-files/results/python_syntax-hi_py | 0 golden-files/results/python_unittests-hi_py | 1 + tools_test.py | 30 ++++++++++++------- 13 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 golden-files/input/hi.py create mode 100644 golden-files/input/hi_test.py create mode 100644 golden-files/results/pep8-hi_py create mode 100644 golden-files/results/pydoc-hi_py create mode 100644 golden-files/results/pyflakes-hi_py create mode 100644 golden-files/results/pylint-hi_py create mode 100644 golden-files/results/python_coverage-hi_py create mode 100644 golden-files/results/python_gut-hi_py create mode 100644 golden-files/results/python_mccabe-hi_py create mode 100644 golden-files/results/python_modulefinder-hi_py create mode 100644 golden-files/results/python_syntax-hi_py create mode 100644 golden-files/results/python_unittests-hi_py diff --git a/golden-files/input/hi.py b/golden-files/input/hi.py new file mode 100644 index 0000000..f579709 --- /dev/null +++ b/golden-files/input/hi.py @@ -0,0 +1,4 @@ + + +def hi(): + print "hi" diff --git a/golden-files/input/hi_test.py b/golden-files/input/hi_test.py new file mode 100644 index 0000000..78b5aa7 --- /dev/null +++ b/golden-files/input/hi_test.py @@ -0,0 +1,15 @@ + + +import unittest + +import hi + + +class HiTestCase(unittest.TestCase): + + def test_hi(self): + hi.hi() + + +if __name__ == "__main__": + unittest.main() diff --git a/golden-files/results/pep8-hi_py b/golden-files/results/pep8-hi_py new file mode 100644 index 0000000..e69de29 diff --git a/golden-files/results/pydoc-hi_py b/golden-files/results/pydoc-hi_py new file mode 100644 index 0000000..6aa598e --- /dev/null +++ b/golden-files/results/pydoc-hi_py @@ -0,0 +1,12 @@ +Help on module hi: + +NAME + hi + +FILE + /home/ahamilton/code/vigil/golden-files/input/hi.py + +FUNCTIONS + hi() + + \ No newline at end of file diff --git a/golden-files/results/pyflakes-hi_py b/golden-files/results/pyflakes-hi_py new file mode 100644 index 0000000..e69de29 diff --git a/golden-files/results/pylint-hi_py b/golden-files/results/pylint-hi_py new file mode 100644 index 0000000..62a5853 --- /dev/null +++ b/golden-files/results/pylint-hi_py @@ -0,0 +1 @@ +No config file found, using default configuration diff --git a/golden-files/results/python_coverage-hi_py b/golden-files/results/python_coverage-hi_py new file mode 100644 index 0000000..a58d963 --- /dev/null +++ b/golden-files/results/python_coverage-hi_py @@ -0,0 +1,4 @@ + + +> def hi(): +> print "hi" \ No newline at end of file diff --git a/golden-files/results/python_gut-hi_py b/golden-files/results/python_gut-hi_py new file mode 100644 index 0000000..9ede04f --- /dev/null +++ b/golden-files/results/python_gut-hi_py @@ -0,0 +1,2 @@ +def hi(): +  \ No newline at end of file diff --git a/golden-files/results/python_mccabe-hi_py b/golden-files/results/python_mccabe-hi_py new file mode 100644 index 0000000..5ebdbcb --- /dev/null +++ b/golden-files/results/python_mccabe-hi_py @@ -0,0 +1 @@ +("3:1: 'hi'", 2) diff --git a/golden-files/results/python_modulefinder-hi_py b/golden-files/results/python_modulefinder-hi_py new file mode 100644 index 0000000..bfb7843 --- /dev/null +++ b/golden-files/results/python_modulefinder-hi_py @@ -0,0 +1,4 @@ + + Name File + ---- ---- +m __main__ ./input/hi.py \ No newline at end of file diff --git a/golden-files/results/python_syntax-hi_py b/golden-files/results/python_syntax-hi_py new file mode 100644 index 0000000..e69de29 diff --git a/golden-files/results/python_unittests-hi_py b/golden-files/results/python_unittests-hi_py new file mode 100644 index 0000000..6084130 --- /dev/null +++ b/golden-files/results/python_unittests-hi_py @@ -0,0 +1 @@ +No tests. \ No newline at end of file diff --git a/tools_test.py b/tools_test.py index 32f0907..aed5536 100755 --- a/tools_test.py +++ b/tools_test.py @@ -68,37 +68,47 @@ class ToolsTestCase(unittest.TestCase): self._sub_tests([(tools.contents, "hi3.py", tools.Status.normal)]) 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): 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): - 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): 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): - 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): - 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): - 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): - 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): 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): - 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): self._sub_tests([(tools.perl_syntax, "perl.pl", tools.Status.ok)])