Fix stale VHI interface + public-API tests (pre-existing, since v2.0.0)#7
Merged
Conversation
- `_real_paths` now creates `project.godot` (required for source-mode resolution in `_resolve_vhi_launch`); tests that need source mode use it; tests that need "not installed" use a plain dir without it. - `test_virtual_hand_default_paths`: removed stale Godot-binary/old- path assertions; now asserts `install_root` resolves to `tools/MyoGestic-VHI` (the 2.0 default), also clears VHI_LAUNCH_MODE. - `test_virtual_hand_env_overrides` / `test_virtual_hand_explicit_args_win_over_env`: use `tmp_path` instead of literal `/tmp/vhi`/`/opt/godot`; create `project.godot` so env-driven source mode resolves correctly. - `test_launcher_returns_process_tuple_list` / `test_launcher_returns_independent_copy` / `test_launcher_accepts_binary_on_path`: all inherit the new `project.godot`-aware `_real_paths`; each also clears VHI_LAUNCH_MODE. - Previously-passing tests (`test_launcher_raises_when_binary_missing`, `test_launcher_raises_when_path_missing`) are adjusted to remain hermetic while keeping their original intent.
Replaced a hardcoded expected set (which included `COL_WIDTH` and `ROW_HEIGHT` removed in the 2.0 rewrite) with a loop over the actual `myogestic.__all__`. The test now asserts that `__all__` is non-empty and that every name it advertises is reachable via `hasattr`, so it stays correct as the public surface evolves.
1349c09 to
c9c06a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes 7 pre-existing test failures that have been broken since the v2.0.0 rewrite (confirmed: they fail on current
main). These are stale tests that drifted from the code — test-only changes, no production code touched.The failures
test_public_api.py::test_top_level_names_are_reachableCOL_WIDTH/ROW_HEIGHTin its expected set; those names were removed in 2.0 (the package now exportsPx/Fr/EdgeTrigger).myogestic.__all__and assert each name is reachable — robust to future additions/renames.6 ×
test_interfaces.py(VHI launcher)Virtual-Hand-Interfaceinstall path (nowtools/MyoGestic-VHI) and a Godot source-mode default (2.0 prefers the installed binary)._real_pathshelper created a project dir without aproject.godotfile, which the 2.0 resolver now requires for source mode →launcher()correctly raised.virtual_hand()/_resolve_vhi_launchsemantics and make them hermetic —tmp_path+monkeypatch, createproject.godot, no dependency on a real Godot/VHI install or machine paths.Result
uv run pytest -q→ 163 passed, 0 failures.Why separate from the OTB PR (#6)
Unrelated to the OTB device-sources feature; kept on its own branch so each PR stays focused. (#6 is purely additive and these failures pre-date it.)