fix: address PR review comments on test suite

- Rename test_start_http_401_unauthorized to test_list_http_401_unauthorized
  to match the actual action="list" being tested (threads #19, #23)
- Use consistent PrefixedID format ("a"*64+":local") in test_start_container
  instead of "abc123def456"*4 concatenation (thread #37)
- Refactor container_actions_require_id to use @pytest.mark.parametrize
  so each action runs independently (thread #18)
- Fix docstring claiming ToolError for test that asserts success in
  test_stop_mutation_returns_null (thread #26)
- Fix inaccurate comment about `in` operator checking truthiness;
  it checks key existence (thread #25)
- Add edge case tests for temperature=0, temperature=null, and
  logFile=null in test_storage.py (thread #31)

Resolves review threads: PRRT_kwDOO6Hdxs5uvO2-, PRRT_kwDOO6Hdxs5uvOcf,
PRRT_kwDOO6Hdxs5uu7zx, PRRT_kwDOO6Hdxs5uvO28, PRRT_kwDOO6Hdxs5uvOcp,
PRRT_kwDOO6Hdxs5uvOcn, PRRT_kwDOO6Hdxs5uvKr3
This commit is contained in:
Jacob Magar
2026-02-15 23:02:32 -05:00
parent c7ed077bb5
commit a0721e38dd
3 changed files with 49 additions and 9 deletions

View File

@@ -158,10 +158,10 @@ class TestVmMutationFailures:
assert result["action"] == "start"
async def test_stop_mutation_returns_null(self, _mock_graphql: AsyncMock) -> None:
"""VM stop returning None in the field should raise ToolError (field not 'in' data)."""
"""VM stop returning None in the field should succeed (key exists, value is None)."""
_mock_graphql.return_value = {"vm": {"stop": None}}
tool_fn = _make_tool()
# The check is `field in data["vm"]` — None is truthy for `in`, so it succeeds
# The check is `field in data["vm"]` — `in` checks key existence, not truthiness
result = await tool_fn(action="stop", vm_id="uuid-1")
assert result["success"] is None
assert result["action"] == "stop"