summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-07-16 21:06:27 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2016-07-16 21:06:27 -0500
commit8b4f12872e871c287864ee4563c18b4499b8b652 (patch)
tree5b9f5e63dc6c739815d31fdaf9cfd55287350001
parent6e3107001f32aaea67e9e72fb0dd8b0beb80c54b (diff)
downloadflake8-legacy-api-tests.tar.gz
Add more simple tests for the legacy apilegacy-api-tests
-rw-r--r--tests/unit/test_legacy_api.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/unit/test_legacy_api.py b/tests/unit/test_legacy_api.py
index 60deea0..0cb3ce9 100644
--- a/tests/unit/test_legacy_api.py
+++ b/tests/unit/test_legacy_api.py
@@ -20,3 +20,31 @@ def test_get_style_guide():
mockedapp.make_guide.assert_called_once_with()
mockedapp.make_file_checker_manager.assert_called_once_with()
assert isinstance(style_guide, api.StyleGuide)
+
+
+def test_styleguide_options():
+ """Show tha we proxy the StyleGuide.options attribute."""
+ app = mock.Mock()
+ app.options = 'options'
+ style_guide = api.StyleGuide(app)
+ assert style_guide.options == 'options'
+
+
+def test_styleguide_paths():
+ """Show tha we proxy the StyleGuide.paths attribute."""
+ app = mock.Mock()
+ app.paths = 'paths'
+ style_guide = api.StyleGuide(app)
+ assert style_guide.paths == 'paths'
+
+
+def test_styleguide_check_files():
+ """Verify we call the right application methods."""
+ paths = ['foo', 'bar']
+ app = mock.Mock()
+ style_guide = api.StyleGuide(app)
+ report = style_guide.check_files(paths)
+
+ app.run_checks.assert_called_once_with(paths)
+ app.report_errors.assert_called_once_with()
+ assert isinstance(report, api.Report)