mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-04 12:16:53 +00:00
Begin adding tests for the Legacy API
This commit is contained in:
parent
e778c6ebc3
commit
6e3107001f
1 changed files with 22 additions and 0 deletions
22
tests/unit/test_legacy_api.py
Normal file
22
tests/unit/test_legacy_api.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"""Tests for Flake8's legacy API."""
|
||||
import mock
|
||||
|
||||
from flake8.api import legacy as api
|
||||
|
||||
|
||||
def test_get_style_guide():
|
||||
"""Verify the methods called on our internal Application."""
|
||||
mockedapp = mock.Mock()
|
||||
with mock.patch('flake8.main.application.Application') as Application:
|
||||
Application.return_value = mockedapp
|
||||
style_guide = api.get_style_guide()
|
||||
|
||||
Application.assert_called_once_with()
|
||||
mockedapp.find_plugins.assert_called_once_with()
|
||||
mockedapp.register_plugin_options.assert_called_once_with()
|
||||
mockedapp.parse_configuration_and_cli.assert_called_once_with([])
|
||||
mockedapp.make_formatter.assert_called_once_with()
|
||||
mockedapp.make_notifier.assert_called_once_with()
|
||||
mockedapp.make_guide.assert_called_once_with()
|
||||
mockedapp.make_file_checker_manager.assert_called_once_with()
|
||||
assert isinstance(style_guide, api.StyleGuide)
|
||||
Loading…
Add table
Add a link
Reference in a new issue