Skip to content

Commit

Permalink
Fix v3_process_put_command (id="", command="{command}")
Browse files Browse the repository at this point in the history
  • Loading branch information
jstabenow committed Feb 27, 2023
1 parent 2e1cd07 commit 9c5b786
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 16 deletions.
29 changes: 17 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
Changelog
---------

## 1.0.0
## 1.1.1

- Initial release
- Add `v3_process_put_command` tests
- Fix `v3_process_put_command` (id="", command="{command}")

## 1.1.0

- Add `metrics_get` endpoint
- Add definition `ConfigApiAuthAuth0Tenant`
- Mod extends login tests
- Mod allows v10.12.0 SRT api (sent_unique__bytes > sent_unique_bytes, recv_loss__bytes > recv_loss_bytes)
- Mod allows `auth0_token` (login)
- Mod `about` is now deprecated. Please use `about_get`
- Mod `metrics` is now deprecated. Please use `metrics_post`
- Add `memory_limit_mbytes` to config.debug
- Fix `access_token` and `refresh_token` parameters (login)
- Fix SRT testing (requires core v10.10+)
- Add `metrics_get` endpoint
- Add definition `ConfigApiAuthAuth0Tenant`
- Mod extends login tests
- Mod allows v10.12.0 SRT api (sent_unique__bytes > sent_unique_bytes, recv_loss__bytes > recv_loss_bytes)
- Mod allows `auth0_token` (login)
- Mod `about` is now deprecated. Please use `about_get`
- Mod `metrics` is now deprecated. Please use `metrics_post`
- Add `memory_limit_mbytes` to config.debug
- Fix `access_token` and `refresh_token` parameters (login)
- Fix SRT testing (requires core v10.10+)

## 1.0.0

- Initial release
4 changes: 1 addition & 3 deletions core_client/base/api/v3_process_put_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ def _build_request(
retries: int = None,
timeout: float = None,
):
if not isinstance(command, dict):
command = command.dict()
if not retries:
retries = client.retries
if not timeout:
Expand All @@ -26,7 +24,7 @@ def _build_request(
"headers": client.headers,
"timeout": timeout,
"data": None,
"json": command,
"json": {"command": f"{command}"},
}, retries


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

setup(
name="core_client",
version="1.1.0",
version="1.1.1",
url="https://github.com/datarhei/core-client-python",
description="datarhei Core PyClient",
author="FOSS GmbH",
Expand Down
11 changes: 11 additions & 0 deletions tests/4_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,17 @@ def test_v3_process_get_state():
assert type(res) is ProcessState


def test_v3_process_put_command_stop():
res = client.v3_process_put_command(id="test", command="stop")
assert type(res) is str
assert res == "OK"


def test_v3_process_put_command_start():
res = client.v3_process_put_command(id="test", command="start")
assert res == "OK"


def test_v3_process_delete():
res = client.v3_process_delete(id="test")
assert type(res) is str
5 changes: 5 additions & 0 deletions tests/5_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,8 @@ def test_v3_process_get_state():
def test_v3_process_delete():
res = client.v3_process_delete(id="unknown")
assert type(res) is Error


def test_v3_process_put_command_start():
res = client.v3_process_put_command(id="unknown", command="start")
assert type(res) is Error

0 comments on commit 9c5b786

Please sign in to comment.