Skip to content

Drop the implementations of service mocks and doubles #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Version Next
* Port test runner to pytest.
* Fix compatibility issue with Werkezeug 3 related to deprecated ``request.charset``.

Version 0.40

* Port test runner to pytest.
* Fix compatibility issue with Werkezeug 3 related to deprecated ``request.charset``.
* Drop service doubles and mocks, and ``acceptable doubles``. Use the OpenAPI spec with tools such as Connexion instead.

Version 0.39

* Assorted fixes and improvements in generated OpenAPI specs
Expand Down
2 changes: 0 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ Design Goals:

- Make it easy to generate API documentation.

- Tools for generating testing doubles from the API metadata.


Usage
-----
Expand Down
29 changes: 0 additions & 29 deletions acceptable/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,23 +141,6 @@ def parse_args(raw_args=None, parser_cls=None, stdin=None, stdout=None):

lint_parser.set_defaults(func=lint_cmd)

doubles_parser = subparser.add_parser("doubles", help="Generate test doubles")
doubles_parser.add_argument(
"metadata",
nargs="?",
type=argparse.FileType("r"),
default=stdin,
help="metadata file path, uses stdin if omitted",
)
doubles_parser.add_argument(
"-n",
"--new-style",
action="store_true",
default=False,
help="Generate new style ServiceFactory mocks",
)
doubles_parser.set_defaults(func=doubles_cmd)

version_parser = subparser.add_parser(
"api-version",
help="Get the current API version from JSON meta, and "
Expand Down Expand Up @@ -362,18 +345,6 @@ def lint_cmd(cli_args, stream=sys.stdout):
return 1 if has_errors else 0


def doubles_cmd(cli_args, stream=sys.stdout):
metadata = json.load(cli_args.metadata)
if cli_args.new_style:
from . import generate_mocks

generate_mocks.generate_service_factory(metadata, stream=stream)
else:
from . import generate_doubles

generate_doubles.generate_service_mock_doubles(metadata, stream=stream)


def version_cmd(cli_args, stream=sys.stdout):
metadata = load_metadata(cli_args.metadata)
json_version = metadata["$version"]
Expand Down
Loading
Loading