Update dependencies#307
Conversation
PR Summary by QodoRefresh uv.lock and align tests with current startup task + tree rendering
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
15 rules 1. Long test function signature
|
| assert "[v:42.5%]" in lines[1] | ||
|
|
||
| def test_scrollable_elements_base_index_offset(self, sample_scroll_element_node): | ||
| def test_scrollable_elements_are_independent_from_interactive_count(self, sample_scroll_element_node): |
There was a problem hiding this comment.
1. Long test function signature 📘 Rule violation ✧ Quality
The modified test function definition exceeds the 100-character maximum line length. This reduces readability and violates the style requirement for changed code.
Agent Prompt
## Issue description
A modified line exceeds the 100-character maximum line length.
## Issue Context
`tests/test_tree_views.py` contains a changed function definition whose full signature is on one line and is longer than 100 characters.
## Fix Focus Areas
- tests/test_tree_views.py[108-108]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| assert lines[0] == 'window "Notepad"' | ||
| assert '(200,100) button "OK"' in lines[1] |
There was a problem hiding this comment.
2. Single-quoted assertions added 📘 Rule violation ✧ Quality
New/modified assertions introduce single-quoted string literals instead of double quotes. This violates the requirement for consistent double-quoted string literals in changed code.
Agent Prompt
## Issue description
Changed lines contain single-quoted string literals; the rule requires double quotes for all string literals.
## Issue Context
Several newly added/modified assertions in `tests/test_tree_views.py` use single quotes (e.g., `assert lines[0] == 'window "Notepad"'`).
## Fix Focus Areas
- tests/test_tree_views.py[70-74]
- tests/test_tree_views.py[87-88]
- tests/test_tree_views.py[103-106]
- tests/test_tree_views.py[118-119]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| @@ -33,6 +20,7 @@ def test_install_writes_start_script_and_creates_task(monkeypatch, tmp_path): | |||
| monkeypatch.setattr(cli, "_resolve_program", lambda: ["C:\\Tools\\windows-mcp.exe"]) | |||
|
|
|||
| calls = [] | |||
| registrations = [] | |||
|
|
|||
| def fake_schtasks(*args: str): | |||
| calls.append(args) | |||
| @@ -41,6 +29,12 @@ def fake_schtasks(*args: str): | |||
| return Mock(returncode=0, stdout="", stderr="") | |||
|
|
|||
| monkeypatch.setattr(cli, "_schtasks", fake_schtasks) | |||
| monkeypatch.setattr( | |||
| cli, | |||
| "_register_task_powershell", | |||
| lambda task_name, script_path: registrations.append((task_name, script_path)) | |||
| or Mock(returncode=0, stdout="", stderr=""), | |||
| ) | |||
|
|
|||
| result = runner.invoke(main, ["install", "--transport", "sse", "--host", "127.0.0.1", "--port", "9000"]) | |||
|
|
|||
| @@ -49,16 +43,7 @@ def fake_schtasks(*args: str): | |||
| assert "windows-mcp.exe serve --transport sse --host 127.0.0.1 --port 9000" in script | |||
| assert '1>>"' in script | |||
| assert '2>>"' in script | |||
| assert ( | |||
| "/Create", | |||
| "/SC", | |||
| "ONLOGON", | |||
| "/TN", | |||
| cli._TASK_NAME, | |||
| "/TR", | |||
| f'"{start_script}"', | |||
| "/F", | |||
| ) in calls | |||
| assert registrations == [(cli._TASK_NAME, str(start_script))] | |||
| assert ("/Run", "/TN", cli._TASK_NAME) in calls | |||
There was a problem hiding this comment.
4. Install test mocks launcher 🐞 Bug ⚙ Maintainability
test_install_writes_start_script_and_creates_task replaces _resolve_program with a fixed exe argv, so it no longer exercises the real interpreter-based launcher used by install(). This reduces coverage for the actual start-script command line (including quoting/-m windows_mcp composition).
Agent Prompt
## Issue description
The install test currently monkeypatches `_resolve_program()` to return a hard-coded `windows-mcp.exe` argv and then asserts that string appears in the generated script. Production `_resolve_program()` always returns `[sys.executable, "-m", "windows_mcp"]`, so the test no longer validates the real install/start-script launcher contract.
## Issue Context
Because `install()` uses `_resolve_program()` to build the command written into the scheduled-task wrapper script, the test should verify that the generated script matches the interpreter-based invocation shape (and handles quoting for paths with spaces).
## Fix Focus Areas
- tests/test_startup_task.py[15-47]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| def test_interactive_elements_preserve_order(self, sample_tree_element_node): | ||
| node2 = TreeElementNode( | ||
| bounding_box=sample_tree_element_node.bounding_box, | ||
| center=sample_tree_element_node.center, |
There was a problem hiding this comment.
5. Tree output checks too partial 🐞 Bug ⚙ Maintainability
Several updated tree-view tests assert only substrings (e.g., element names) instead of the full rendered lines, making them less likely to catch regressions in the grouped tree formatting used in snapshot outputs. This can allow unintended changes to connectors/action/metadata formatting to pass while still matching the loose substrings.
Agent Prompt
## Issue description
The tree-view tests were updated to the grouped tree renderer, but some assertions now only check for substrings like `button "OK"` / `pane "Document"`. This weakens the guarantee that the actual tree formatting (connectors, `[action: ...]`, and metadata tokens) remains stable.
## Issue Context
These strings are surfaced in snapshot responses (`capture_desktop_state`) and are produced by `_render_tree()`.
## Fix Focus Areas
- tests/test_tree_views.py[66-120]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
uv.lockfromuv lock --upgrade.to_row()format.Why
The dependency refresh exposed stale test expectations that no longer matched the current implementation on
main. The production behavior was already using the newer contracts, so the tests were updated to cover that behavior.Validation
uv run --extra dev pytest-> 318 passeduv run --extra dev ruff check tests/test_startup_task.py tests/test_tree_views.py-> all checks passed