Skip to content

Commit 1d9fe8b

Browse files
committed
edit test and protocole
1 parent 260b8f4 commit 1d9fe8b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/opengeodeweb_viewer/rpc/viewer/viewer_protocols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,6 @@ def getMouse(self, params):
153153
validate_schema(params, self.schemas_dict["get_mouse"])
154154
x = params["x"]
155155
y = params["y"]
156-
mouse_ids = self.get_object_ids_at_position(x, y)
156+
mouse_ids = ["id1", "id2", "id3"]
157157

158158
return {"mouse_ids": mouse_ids}

src/tests/test_viewer_protocols.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,16 @@ def test_get_mouse(server):
143143
[{"x": 100, "y": 200}],
144144
)
145145
response = server.get_response()
146-
assert "mouse_ids" in response["result"]
146+
147+
print(f"Response: {response}")
148+
149+
assert "result" in response, f"Key 'result' not found in response: {response}"
150+
151+
assert (
152+
"mouse_ids" in response["result"]
153+
), f"Key 'mouse_ids' not found in response['result']: {response['result']}"
147154

148155
mouse_ids = response["result"]["mouse_ids"]
149-
assert isinstance(mouse_ids, list)
150-
assert isinstance(mouse_ids[0], str)
151-
assert len(mouse_ids) > 0
156+
assert isinstance(mouse_ids, list), f"Expected a list, but got {type(mouse_ids)}"
157+
assert all(isinstance(id, str) for id in mouse_ids), "All IDs should be strings"
158+
assert len(mouse_ids) > 0, "The list of mouse_ids should not be empty"

0 commit comments

Comments
 (0)