Skip to content

Commit

Permalink
Merge pull request #155 from maxiberta/SN-3271-drop-mocks-and-doubles
Browse files Browse the repository at this point in the history
Drop the implementations of service mocks and doubles
  • Loading branch information
maxiberta authored Sep 5, 2024
2 parents a4528c4 + 5a025aa commit c37ceb2
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 2,102 deletions.
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

0 comments on commit c37ceb2

Please sign in to comment.