standardbots 2.0.0.dev1736549072__py3-none-any.whl → 2.0.0.dev1737492400__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of standardbots might be problematic. Click here for more details.
- standardbots/auto_generated/models.py +9 -7
- {standardbots-2.0.0.dev1736549072.dist-info → standardbots-2.0.0.dev1737492400.dist-info}/METADATA +1 -1
- standardbots-2.0.0.dev1737492400.dist-info/RECORD +11 -0
- {standardbots-2.0.0.dev1736549072.dist-info → standardbots-2.0.0.dev1737492400.dist-info}/top_level.txt +1 -0
- tests/fixtures/__init__.py +0 -0
- tests/fixtures/client_fixt.py +25 -0
- tests/fixtures/routines_fixt.py +48 -0
- standardbots-2.0.0.dev1736549072.dist-info/RECORD +0 -8
- {standardbots-2.0.0.dev1736549072.dist-info → standardbots-2.0.0.dev1737492400.dist-info}/WHEEL +0 -0
|
@@ -1087,6 +1087,8 @@ class ErrorEnum(Enum):
|
|
|
1087
1087
|
"""Requested resource not found"""
|
|
1088
1088
|
InvalidSpaceSpecified = "invalid_space_specified"
|
|
1089
1089
|
"""Space specified was invalid or not found"""
|
|
1090
|
+
InvalidParameters = "invalid_parameters"
|
|
1091
|
+
"""Parameters are invalid"""
|
|
1090
1092
|
|
|
1091
1093
|
def parse_error_enum(data: object) -> ErrorEnum:
|
|
1092
1094
|
return ErrorEnum(data)
|
|
@@ -3037,7 +3039,7 @@ class ErrorResponse:
|
|
|
3037
3039
|
if value is None:
|
|
3038
3040
|
return [False, "error is required for ErrorResponse"]
|
|
3039
3041
|
|
|
3040
|
-
if not ((isinstance(value, str) and ErrorEnum in ['authorization_required', 'routine_must_be_running', 'api_control_required', 'robot_brakes_disengage_failed', 'robot_brakes_engage_failed', 'request_failed_validation', 'robot_not_idle', 'brakes_must_be_engaged', 'brakes_must_be_disengaged', 'equipment_no_matching', 'service_initializing', 'camera_disconnected', 'settings_validation_error', 'settings_timeout', 'internal_server_error', 'recovery_error', 'not_found', 'invalid_space_specified']) or isinstance(value, ErrorEnum)):
|
|
3042
|
+
if not ((isinstance(value, str) and ErrorEnum in ['authorization_required', 'routine_must_be_running', 'api_control_required', 'robot_brakes_disengage_failed', 'robot_brakes_engage_failed', 'request_failed_validation', 'robot_not_idle', 'brakes_must_be_engaged', 'brakes_must_be_disengaged', 'equipment_no_matching', 'service_initializing', 'camera_disconnected', 'settings_validation_error', 'settings_timeout', 'internal_server_error', 'recovery_error', 'not_found', 'invalid_space_specified', 'invalid_parameters']) or isinstance(value, ErrorEnum)):
|
|
3041
3043
|
return [False, "error must be of type ErrorEnum for ErrorResponse, got " + type(value).__name__]
|
|
3042
3044
|
|
|
3043
3045
|
return [True, ""]
|
|
@@ -5935,7 +5937,7 @@ class Space:
|
|
|
5935
5937
|
kind: Union[str, None] = None
|
|
5936
5938
|
name: Union[str, None] = None
|
|
5937
5939
|
description: Union[str, None] = None
|
|
5938
|
-
|
|
5940
|
+
is_global: Union[bool, None] = None
|
|
5939
5941
|
positions: Union[SpacePositionsMap, None] = None
|
|
5940
5942
|
|
|
5941
5943
|
def validate_id(self, value: str) -> Tuple[bool, str]:
|
|
@@ -5974,12 +5976,12 @@ class Space:
|
|
|
5974
5976
|
|
|
5975
5977
|
return [True, ""]
|
|
5976
5978
|
|
|
5977
|
-
def
|
|
5979
|
+
def validate_is_global(self, value: bool) -> Tuple[bool, str]:
|
|
5978
5980
|
if value is None:
|
|
5979
5981
|
return [True, ""]
|
|
5980
5982
|
|
|
5981
5983
|
if not isinstance(value, bool):
|
|
5982
|
-
return [False, "
|
|
5984
|
+
return [False, "is_global must be of type bool for Space, got " + type(value).__name__]
|
|
5983
5985
|
|
|
5984
5986
|
return [True, ""]
|
|
5985
5987
|
|
|
@@ -6006,7 +6008,7 @@ class Space:
|
|
|
6006
6008
|
is_valid, error_str = self.validate_description(self.description)
|
|
6007
6009
|
if not is_valid:
|
|
6008
6010
|
raise TypeError(error_str)
|
|
6009
|
-
is_valid, error_str = self.
|
|
6011
|
+
is_valid, error_str = self.validate_is_global(self.is_global)
|
|
6010
6012
|
if not is_valid:
|
|
6011
6013
|
raise TypeError(error_str)
|
|
6012
6014
|
is_valid, error_str = self.validate_positions(self.positions)
|
|
@@ -6019,7 +6021,7 @@ def parse_space(data: object):
|
|
|
6019
6021
|
kind=parse_str(data["kind"]) if "kind" in data and data.get("kind") is not None else None,
|
|
6020
6022
|
name=parse_str(data["name"]) if "name" in data and data.get("name") is not None else None,
|
|
6021
6023
|
description=parse_str(data["description"]) if "description" in data and data.get("description") is not None else None,
|
|
6022
|
-
|
|
6024
|
+
is_global=parse_bool(data["is_global"]) if "is_global" in data and data.get("is_global") is not None else None,
|
|
6023
6025
|
positions=parse_space_positions_map(data["positions"]) if "positions" in data and data.get("positions") is not None else None,
|
|
6024
6026
|
)
|
|
6025
6027
|
|
|
@@ -6029,7 +6031,7 @@ def serialize_space(data: Space) -> object:
|
|
|
6029
6031
|
"kind": None if data.kind is None else serialize_str(data.kind),
|
|
6030
6032
|
"name": None if data.name is None else serialize_str(data.name),
|
|
6031
6033
|
"description": None if data.description is None else serialize_str(data.description),
|
|
6032
|
-
"
|
|
6034
|
+
"is_global": None if data.is_global is None else serialize_bool(data.is_global),
|
|
6033
6035
|
"positions": None if data.positions is None else serialize_space_positions_map(data.positions),
|
|
6034
6036
|
}
|
|
6035
6037
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
standardbots/__init__.py,sha256=PT6Z2HPama2fb6SaNhF3J1skpYABQWGgDzKEtQY6BDM,29
|
|
2
|
+
standardbots/auto_generated/__init__.py,sha256=PZtDUzYcjIO6R-gE-0NzY0vFXk1Je1tJ3je0ivV5o-k,98
|
|
3
|
+
standardbots/auto_generated/apis.py,sha256=G3sh8CbbfjxoFTmzc8xI4swajPxD5xOWTaKg6hjY5kg,91393
|
|
4
|
+
standardbots/auto_generated/models.py,sha256=VtkMHR2aEnsXO3U2xuhDQrRMcVCQp2uRj_WbAKLZYAc,261851
|
|
5
|
+
tests/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
tests/fixtures/client_fixt.py,sha256=Va_L90iYIYPguyqr2eYE15ERkCgGgbee3AVLei8TCq4,644
|
|
7
|
+
tests/fixtures/routines_fixt.py,sha256=CpdwndlSDmwFCxzCXicIAeFT2CO2VQqFm_6gVAF385c,1326
|
|
8
|
+
standardbots-2.0.0.dev1737492400.dist-info/METADATA,sha256=Kq7S7_-CRiWzSdLyABdW0bz8HDUlFKyP33OYJxttDx8,558
|
|
9
|
+
standardbots-2.0.0.dev1737492400.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
10
|
+
standardbots-2.0.0.dev1737492400.dist-info/top_level.txt,sha256=eHgNxowGe-eEE7gOyeuwXN3bHLClu-TQ1VnsOOzzTkw,19
|
|
11
|
+
standardbots-2.0.0.dev1737492400.dist-info/RECORD,,
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Fixtures: API Clients"""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
from standardbots import StandardBotsRobot
|
|
7
|
+
from standardbots.auto_generated.apis import RobotKind
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@pytest.fixture(scope="session")
|
|
11
|
+
def client_live(api_url: str, api_token: str):
|
|
12
|
+
"""StandardBotsRobot API client - Live mode"""
|
|
13
|
+
return StandardBotsRobot(
|
|
14
|
+
url=api_url,
|
|
15
|
+
token=api_token,
|
|
16
|
+
robot_kind=RobotKind.Live,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@pytest.fixture(scope="session")
|
|
21
|
+
def client_sim(api_url: str, api_token: str):
|
|
22
|
+
"""StandardBotsRobot API client - Simulated mode"""
|
|
23
|
+
return StandardBotsRobot(
|
|
24
|
+
url=api_url, token=api_token, robot_kind=RobotKind.Simulated
|
|
25
|
+
)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Fixtures: Routines"""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from standardbots import StandardBotsRobot
|
|
5
|
+
from standardbots.auto_generated import models
|
|
6
|
+
|
|
7
|
+
SAMPLE_ROUTINE_NAME = "Test Public API"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@pytest.fixture(scope="session")
|
|
11
|
+
def routine_sample(client_live: StandardBotsRobot) -> models.Routine:
|
|
12
|
+
"""Fixture: Get a sample routine.
|
|
13
|
+
|
|
14
|
+
Relies on `StandardBotsRobot#routine_editor#routines#list`
|
|
15
|
+
"""
|
|
16
|
+
limit = 100
|
|
17
|
+
offset = 0
|
|
18
|
+
i = 0
|
|
19
|
+
while i < 100:
|
|
20
|
+
try:
|
|
21
|
+
with client_live.connection():
|
|
22
|
+
res = client_live.routine_editor.routines.list(
|
|
23
|
+
limit=limit, offset=offset
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
data = res.ok()
|
|
27
|
+
except Exception as e:
|
|
28
|
+
raise ValueError("Failed to fetch a sample routine.") from e
|
|
29
|
+
|
|
30
|
+
if len(data.items) == 0:
|
|
31
|
+
break
|
|
32
|
+
|
|
33
|
+
routines = [r for r in data.items if r.name == SAMPLE_ROUTINE_NAME]
|
|
34
|
+
if len(routines) != 0:
|
|
35
|
+
return routines[0]
|
|
36
|
+
|
|
37
|
+
offset += limit
|
|
38
|
+
i += 1
|
|
39
|
+
|
|
40
|
+
raise ValueError(
|
|
41
|
+
f"Failed to find a routine named '{SAMPLE_ROUTINE_NAME}'. Please create a routine with this name in order to continue testing."
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@pytest.fixture(scope="session")
|
|
46
|
+
def routine_sample_id(routine_sample: models.Routine) -> str:
|
|
47
|
+
"""Fixture: ID of sample routine"""
|
|
48
|
+
return routine_sample.id
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
standardbots/__init__.py,sha256=PT6Z2HPama2fb6SaNhF3J1skpYABQWGgDzKEtQY6BDM,29
|
|
2
|
-
standardbots/auto_generated/__init__.py,sha256=PZtDUzYcjIO6R-gE-0NzY0vFXk1Je1tJ3je0ivV5o-k,98
|
|
3
|
-
standardbots/auto_generated/apis.py,sha256=G3sh8CbbfjxoFTmzc8xI4swajPxD5xOWTaKg6hjY5kg,91393
|
|
4
|
-
standardbots/auto_generated/models.py,sha256=AECDa7g9WYqC8QOuxFnc36wBhXmS1J0t7saaysLfOTc,261743
|
|
5
|
-
standardbots-2.0.0.dev1736549072.dist-info/METADATA,sha256=nzBvEA1WUoAh1W4lcVvb937oJZ8JLE0-yJwUAcpZ-Pw,558
|
|
6
|
-
standardbots-2.0.0.dev1736549072.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
7
|
-
standardbots-2.0.0.dev1736549072.dist-info/top_level.txt,sha256=8Cb2uu5PLn7ayueFHSdWnFlKJzvSezDEKTHiup_bxH0,13
|
|
8
|
-
standardbots-2.0.0.dev1736549072.dist-info/RECORD,,
|
{standardbots-2.0.0.dev1736549072.dist-info → standardbots-2.0.0.dev1737492400.dist-info}/WHEEL
RENAMED
|
File without changes
|