Fix parameters in the CLI interface

This commit is contained in:
Rafael Caricio
2016-09-14 21:06:17 +02:00
parent dbe20e9a14
commit 07c6eb7b8a
2 changed files with 19 additions and 21 deletions

View File

@@ -83,22 +83,27 @@ def run(spec_file,
logging_level = logging.DEBUG
logging.basicConfig(level=logging_level)
sys.path.insert(1, path.abspath(base_path or '.'))
spec_file_full_path = path.abspath(spec_file)
base_path = base_path or path.dirname(spec_file_full_path)
sys.path.insert(1, path.abspath(base_path))
resolver_error = None
if stub:
resolver_error = 501
app = App(__name__)
app.add_api(path.abspath(spec_file), resolver_error=resolver_error)
app.run(
port=port,
server=wsgi_server,
swagger_json=hide_spec or None,
swagger_ui=hide_console_ui or None,
app = App(__name__,
swagger_json=hide_spec is False,
swagger_ui=hide_console_ui is False,
swagger_path=console_ui_from or None,
swagger_url=console_ui_url or None,
strict_validation=strict_validation,
validate_responses=validate_responses,
auth_all_paths=auth_all_paths,
debug=debug)
app.add_api(spec_file_full_path,
resolver_error=resolver_error,
validate_responses=validate_responses,
strict_validation=strict_validation)
app.run(port=port,
server=wsgi_server,
debug=debug)

View File

@@ -38,13 +38,6 @@ def test_run_simple_spec(mock_app_run, spec_file):
mock_app_run.run.assert_called_with(
port=default_port,
server=None,
strict_validation=False,
swagger_json=None,
swagger_path=None,
swagger_ui=None,
swagger_url=None,
auth_all_paths=False,
validate_responses=False,
debug=False)