Skip to content

Commit

Permalink
update tests and schema
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-dot committed Apr 2, 2024
1 parent 188f0c3 commit 05aaaa3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion docs/user/reference/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ paths:
'200':
content:
application/json:
schema: {}
schema:
$ref: '#/components/schemas/EnvironmentResponse'
description: Successful Response
summary: Delete Environment
get:
Expand Down
4 changes: 2 additions & 2 deletions src/blueapi/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ def stop(obj: dict) -> None:
@click.pass_obj
def env(obj: dict, reload: Optional[bool]) -> None:
"""
Inspect or restart the environment
Inspect or restart the environment
"""

client: BlueapiRestClient = obj["rest_client"]
if reload:
print('reloading the environment...')
print("reloading the environment...")
pprint(client.reload_environemnt())
pprint(client.get_environment())

Expand Down
11 changes: 5 additions & 6 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ def test_config_passed_down_to_command_children(
}



@pytest.mark.handler
@patch("blueapi.service.handler.Handler")
@patch("requests.request")
Expand All @@ -183,13 +182,13 @@ def test_get_env(
runner: CliRunner,
):
with patch("uvicorn.run", side_effect=None):
result = runner.invoke(main, [ "serve"])
result = runner.invoke(main, ["serve"])

assert result.exit_code == 0

mock_requests.return_value = Mock()

runner.invoke( main, ["controller", "env"])
runner.invoke(main, ["controller", "env"])

assert mock_requests.call_args[0] == (
"GET",
Expand All @@ -208,15 +207,15 @@ def test_reset_env(
runner: CliRunner,
):
with patch("uvicorn.run", side_effect=None):
result = runner.invoke(main, [ "serve"])
result = runner.invoke(main, ["serve"])

assert result.exit_code == 0

mock_requests.return_value = Mock()

runner.invoke( main, ["controller", "env" , "-r"])
runner.invoke(main, ["controller", "env", "-r"])

assert mock_requests.call_args[0] == (
"DELETE",
"http://localhost:8000/environment",
)
)

0 comments on commit 05aaaa3

Please sign in to comment.