VGalaxies commented on code in PR #329:
URL: https://github.com/apache/hugegraph-ai/pull/329#discussion_r3371623914
##########
hugegraph-python-client/src/tests/api/test_graph.py:
##########
@@ -89,6 +106,16 @@ def test_remove_vertex_by_id(self):
except NotFoundError as e:
self.assertTrue("Alice\\' does not exist" in str(e))
+ def test_remove_vertex_by_number_id(self):
+ vertex = self.graph.addVertex("department", {"name": "DepartmentA",
"headcount": 10, "floor": 1})
+ self.graph.removeVertexById(vertex.id)
+ try:
+ self.graph.getVertexById(vertex.id)
+ except NotFoundError as e:
+ msg = "\\'{}\\' does not exist".format(vertex.id)
+ logger.info(f'test_msg: {msg}')
Review Comment:
**Medium: Undefined logger in number ID deletion test**
`hugegraph-python-client/src/tests/api/test_graph.py:116`
**Evidence**
- `test_remove_vertex_by_number_id()` catches `NotFoundError`, then calls
`logger.info(...)`, but this file only imports `unittest`, `NotFoundError`, and
`ClientUtils`.
**Impact**
- When `removeVertexById()` works and `getVertexById()` raises the expected
`NotFoundError`, the test fails with `NameError` instead of asserting the
client behavior.
**Requested fix**
- Remove the debug logging line or import/define a logger before using it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]