Skip to content

Commit 9c5b786

Browse files
committed
Fix v3_process_put_command (id="", command="{command}")
1 parent 2e1cd07 commit 9c5b786

File tree

5 files changed

+35
-16
lines changed

5 files changed

+35
-16
lines changed

CHANGELOG.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
Changelog
22
---------
33

4-
## 1.0.0
4+
## 1.1.1
55

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

89
## 1.1.0
910

10-
- Add `metrics_get` endpoint
11-
- Add definition `ConfigApiAuthAuth0Tenant`
12-
- Mod extends login tests
13-
- Mod allows v10.12.0 SRT api (sent_unique__bytes > sent_unique_bytes, recv_loss__bytes > recv_loss_bytes)
14-
- Mod allows `auth0_token` (login)
15-
- Mod `about` is now deprecated. Please use `about_get`
16-
- Mod `metrics` is now deprecated. Please use `metrics_post`
17-
- Add `memory_limit_mbytes` to config.debug
18-
- Fix `access_token` and `refresh_token` parameters (login)
19-
- Fix SRT testing (requires core v10.10+)
11+
- Add `metrics_get` endpoint
12+
- Add definition `ConfigApiAuthAuth0Tenant`
13+
- Mod extends login tests
14+
- Mod allows v10.12.0 SRT api (sent_unique__bytes > sent_unique_bytes, recv_loss__bytes > recv_loss_bytes)
15+
- Mod allows `auth0_token` (login)
16+
- Mod `about` is now deprecated. Please use `about_get`
17+
- Mod `metrics` is now deprecated. Please use `metrics_post`
18+
- Add `memory_limit_mbytes` to config.debug
19+
- Fix `access_token` and `refresh_token` parameters (login)
20+
- Fix SRT testing (requires core v10.10+)
21+
22+
## 1.0.0
23+
24+
- Initial release

core_client/base/api/v3_process_put_command.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ def _build_request(
1414
retries: int = None,
1515
timeout: float = None,
1616
):
17-
if not isinstance(command, dict):
18-
command = command.dict()
1917
if not retries:
2018
retries = client.retries
2119
if not timeout:
@@ -26,7 +24,7 @@ def _build_request(
2624
"headers": client.headers,
2725
"timeout": timeout,
2826
"data": None,
29-
"json": command,
27+
"json": {"command": f"{command}"},
3028
}, retries
3129

3230

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
setup(
1717
name="core_client",
18-
version="1.1.0",
18+
version="1.1.1",
1919
url="https://github.com/datarhei/core-client-python",
2020
description="datarhei Core PyClient",
2121
author="FOSS GmbH",

tests/4_main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,17 @@ def test_v3_process_get_state():
288288
assert type(res) is ProcessState
289289

290290

291+
def test_v3_process_put_command_stop():
292+
res = client.v3_process_put_command(id="test", command="stop")
293+
assert type(res) is str
294+
assert res == "OK"
295+
296+
297+
def test_v3_process_put_command_start():
298+
res = client.v3_process_put_command(id="test", command="start")
299+
assert res == "OK"
300+
301+
291302
def test_v3_process_delete():
292303
res = client.v3_process_delete(id="test")
293304
assert type(res) is str

tests/5_errors.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,8 @@ def test_v3_process_get_state():
174174
def test_v3_process_delete():
175175
res = client.v3_process_delete(id="unknown")
176176
assert type(res) is Error
177+
178+
179+
def test_v3_process_put_command_start():
180+
res = client.v3_process_put_command(id="unknown", command="start")
181+
assert type(res) is Error

0 commit comments

Comments
 (0)