Skip to content

Commit

Permalink
Fix writing errors
Browse files Browse the repository at this point in the history
Change _ to cap letter in class name
  • Loading branch information
OleDrange committed Mar 10, 2023
1 parent d5cb477 commit ac0f2dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/isar_exr/api/energy_robotics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def pause_current_mission(self, exr_robot_id: str) -> None:
if not success:
raise RobotException(f"Invalid status after pausing mission: '{status}'")

def create_point_of_intereste(
def create_point_of_interest(
self, point_of_intrest_input: AddPointOfInterestInput
) -> str:
mutation_string: str = """
Expand Down
20 changes: 10 additions & 10 deletions tests/api/test_energy_robotics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ def test_fails_if_status_is_anything_else(self):
"isar_exr.api.graphql_client.get_access_token",
mock.Mock(return_value="test_token"),
)
class Test_create_point_of_intrest:
class TestCreatePointOfinterest:
expected_return_id = "point_of_interest_type_id"
api_point_of_intrest_response: Dict[str, Any] = {
api_point_of_interest_response: Dict[str, Any] = {
"addPointOfInterest": {"id": expected_return_id}
}

@mock.patch.object(
Client, "execute", mock.Mock(return_value=api_point_of_intrest_response)
Client, "execute", mock.Mock(return_value=api_point_of_interest_response)
)
def test_succeeds_if_id_returned(self):
api: EnergyRoboticsApi = EnergyRoboticsApi()
Expand All @@ -77,7 +77,7 @@ def test_succeeds_if_id_returned(self):
pose=pose,
photoAction=action,
)
return_value = api.create_point_of_intereste(point_of_intrest_input=poi)
return_value = api.create_point_of_intereste(point_of_interest_input=poi)
assert return_value == self.expected_return_id

@mock.patch.object(Client, "execute", mock.Mock(side_effect=Exception))
Expand All @@ -97,8 +97,8 @@ def test_api_return_exeption(self):
pose=pose,
photoAction=action,
)
with pytest.raises(expected_exception=Exception):
api.create_point_of_intereste(point_of_intrest_input=poi)
with pytest.raises(expected_exception=RobotException):
api.create_point_of_intereste(point_of_interest_input=poi)


@mock.patch(
Expand Down Expand Up @@ -272,7 +272,7 @@ def test_returns_false_if_robot_is_going_toawake_status_going_to_sleep(self):
"isar_exr.api.graphql_client.get_access_token",
mock.Mock(return_value="test_token"),
)
class Test_create_mission_definition:
class TestCreateMissionDefinition:
expected_return_id = "mission_definition"
api_execute_response: Dict[str, Any] = {
"createMissionDefinition": {"id": expected_return_id}
Expand All @@ -291,7 +291,7 @@ def test_succeeds_if_id_returned(self):
@mock.patch.object(Client, "execute", mock.Mock(side_effect=Exception))
def test_api_return_exeption(self):
api: EnergyRoboticsApi = EnergyRoboticsApi()
with pytest.raises(expected_exception=Exception):
with pytest.raises(expected_exception=RobotException):
api.create_mission_definition(
site_id="mock_site_id",
mission_name="mock_mission_name",
Expand All @@ -303,7 +303,7 @@ def test_api_return_exeption(self):
"isar_exr.api.graphql_client.get_access_token",
mock.Mock(return_value="test_token"),
)
class Test_start_mission_execution:
class TestStartMissionExecution:
expected_return_id = "mission_execution_id"
api_execute_response: Dict[str, Any] = {
"startMissionExecution": {"id": expected_return_id}
Expand All @@ -321,7 +321,7 @@ def test_succeeds_if_id_returned(self):
@mock.patch.object(Client, "execute", mock.Mock(side_effect=Exception))
def test_api_return_exeption(self):
api: EnergyRoboticsApi = EnergyRoboticsApi()
with pytest.raises(expected_exception=Exception):
with pytest.raises(expected_exception=RobotException):
api.start_mission_execution(
mission_definition_id="mock:mission:definition_id",
robot_id="mock_robot_id",
Expand Down

0 comments on commit ac0f2dc

Please sign in to comment.