repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
fennerm/flashfocus | from __future__ import annotations
from collections import namedtuple
from unittest.mock import MagicMock
import pytest
from xcffib.xproto import CreateNotifyEvent
from flashfocus.compat import (
DisplayHandler,
DisplayProtocol,
Window,
get_display_protocol,
list_mapped_windows,
)
from flashfocus... | should_match | assert | variable | tests/test_display_protocols_x11.py | test_rule_matching | 80 | null | |
fennerm/flashfocus | from __future__ import annotations
from collections import namedtuple
from unittest.mock import MagicMock
import pytest
from xcffib.xproto import CreateNotifyEvent
from flashfocus.compat import (
DisplayHandler,
DisplayProtocol,
Window,
get_display_protocol,
list_mapped_windows,
)
from flashfocus... | {"window_id": "window_0_1", "window_class": "Window_0_1"} | assert | collection | tests/test_display_protocols_x11.py | test_properties | 84 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
from unittest.mock import MagicMock, call
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.client import client_request_flash
from flashfocus.compat import Window
from flashfocus.display import WMEvent, WMEventType
from flashfocus.serv... | [1, 0.2, 1] | assert | collection | tests/test_server.py | test_flash_lone_windows_set_to_never_with_existing_window | 136 | null | |
fennerm/flashfocus | from __future__ import annotations
from copy import deepcopy
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.config import (
construct_config_error_msg,
dehyphen,
get_default_config_file,
hierarchical_merge,
load_config,
load_merged_config,
merge_config_sources,
... | ConfigLoadError) | pytest.raises | variable | tests/test_config.py | test_invalid_yaml_passed_to_load_config | 252 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
from unittest.mock import MagicMock, call
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.client import client_request_flash
from flashfocus.compat import Window
from flashfocus.display import WMEvent, WMEventType
from flashfocus.serv... | 0.5) | pytest.approx | numeric_literal | tests/test_server.py | test_per_window_opacity_settings_handled_correctly_by_server | 122 | null | |
fennerm/flashfocus | from __future__ import annotations
import socket
from threading import Thread
from time import sleep
from pytest import raises
from flashfocus.client import ClientMonitor, client_request_flash
from flashfocus.compat import Window
from flashfocus.display import WMEvent, WMEventType
from tests.helpers import StubServer... | [ WMEvent(window=windows[0], event_type=WMEventType.CLIENT_REQUEST), WMEvent(window=windows[0], event_type=WMEventType.CLIENT_REQUEST), ] | assert | collection | tests/test_client.py | test_client_monitor_handles_client_requests | 31 | null | |
fennerm/flashfocus | from __future__ import annotations
from copy import deepcopy
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.config import (
construct_config_error_msg,
dehyphen,
get_default_config_file,
hierarchical_merge,
load_config,
load_merged_config,
merge_config_sources,
... | 0.2 | assert | numeric_literal | tests/test_config.py | test_load_merged_config_with_custom_config | 269 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
from unittest.mock import MagicMock, call
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.client import client_request_flash
from flashfocus.compat import Window
from flashfocus.display import WMEvent, WMEventType
from flashfocus.serv... | 1) | pytest.approx | numeric_literal | tests/test_server.py | test_window_opacity_unset_on_shutdown | 90 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
import pytest
from pytest_mock import MockerFixture
from flashfocus.compat import Window
from flashfocus.flasher import Flasher
from tests.helpers import change_focus, new_watched_window, watching_windows
@pytest.mark.parametrize(
"flash_opacity,default_... | pytest.approx(expected) | assert | func_call | tests/test_flasher.py | test_compute_flash_series | 68 | null | |
fennerm/flashfocus | from __future__ import annotations
import pytest
from flashfocus.compat import DisplayHandler, Window, get_workspace
from flashfocus.display import WMEvent, WMEventType
from flashfocus.errors import WMError
from tests.compat import change_focus, set_fullscreen, unset_fullscreen
from tests.helpers import new_window_ses... | opacity) | pytest.approx | variable | tests/test_compat.py | test_window_set_opacity | 20 | null | |
fennerm/flashfocus | from __future__ import annotations
import socket
from threading import Thread
from time import sleep
from pytest import raises
from flashfocus.client import ClientMonitor, client_request_flash
from flashfocus.compat import Window
from flashfocus.display import WMEvent, WMEventType
from tests.helpers import StubServer... | [b"1"] | assert | collection | tests/test_client.py | test_client_request_flash | 21 | null | |
fennerm/flashfocus | import pytest
from typing import Any
from flashfocus.cli import init_server
from flashfocus.server import FlashServer
def return_opacity(self: FlashServer, *args: Any, **kwargs: Any) -> float:
return self.router.flashers[-1].flash_opacity
def test_custom_configfile( # type: ignore[no-untyped-def]
monkeypatc... | 0.5 | assert | numeric_literal | tests/test_cli.py | test_custom_configfile | 22 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
from unittest.mock import MagicMock, call
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.client import client_request_flash
from flashfocus.compat import Window
from flashfocus.display import WMEvent, WMEventType
from flashfocus.serv... | 0.2) | pytest.approx | numeric_literal | tests/test_server.py | test_per_window_opacity_settings_handled_correctly_by_server | 120 | null | |
fennerm/flashfocus | import os
from pathlib import Path
from flashfocus.pid import determine_runtime_dir
def test_determine_runtime_dir_with_xdg() -> None:
os.environ["XDG_RUNTIME_DIR"] = "/run/user/1000"
assert determine_runtime_dir() == | Path("/run/user/1000") | assert | func_call | tests/test_pid.py | test_determine_runtime_dir_with_xdg | 10 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
from unittest.mock import MagicMock, call
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.client import client_request_flash
from flashfocus.compat import Window
from flashfocus.display import WMEvent, WMEventType
from flashfocus.serv... | 1 | assert | numeric_literal | tests/test_server.py | test_flash_fullscreen_server_flashes_fullscreen_windows | 176 | null | |
fennerm/flashfocus | from __future__ import annotations
from copy import deepcopy
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.config import (
construct_config_error_msg,
dehyphen,
get_default_config_file,
hierarchical_merge,
load_config,
load_merged_config,
merge_config_sources,
... | [isinstance(value, typ) for typ in expected_types[name]] | assert | collection | tests/test_config.py | check_validated_config | 87 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
from unittest.mock import MagicMock, call
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.client import client_request_flash
from flashfocus.compat import Window
from flashfocus.display import WMEvent, WMEventType
from flashfocus.serv... | 0.4) | pytest.approx | numeric_literal | tests/test_server.py | test_new_window_opacity_set_to_default | 100 | null | |
fennerm/flashfocus | from __future__ import annotations
from copy import deepcopy
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.config import (
construct_config_error_msg,
dehyphen,
get_default_config_file,
hierarchical_merge,
load_config,
load_merged_config,
merge_config_sources,
... | default_config["flash_opacity"] | assert | complex_expr | tests/test_config.py | test_rule_defaults_inherited_from_global_param | 205 | null | |
fennerm/flashfocus | from __future__ import annotations
from copy import deepcopy
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.config import (
construct_config_error_msg,
dehyphen,
get_default_config_file,
hierarchical_merge,
load_config,
load_merged_config,
merge_config_sources,
... | 0.5 | assert | numeric_literal | tests/test_config.py | test_load_merged_config_with_no_custom_config | 260 | null | |
fennerm/flashfocus | from __future__ import annotations
import pytest
from flashfocus.compat import DisplayHandler, Window, get_workspace
from flashfocus.display import WMEvent, WMEventType
from flashfocus.errors import WMError
from tests.compat import change_focus, set_fullscreen, unset_fullscreen
from tests.helpers import new_window_ses... | TypeError) | pytest.raises | variable | tests/test_compat.py | test_window_equality_to_none_raises_error | 45 | null | |
fennerm/flashfocus | from __future__ import annotations
import pytest
from flashfocus.compat import DisplayHandler, Window, get_workspace
from flashfocus.display import WMEvent, WMEventType
from flashfocus.errors import WMError
from tests.compat import change_focus, set_fullscreen, unset_fullscreen
from tests.helpers import new_window_ses... | [ WMEvent(window=windows[1], event_type=WMEventType.FOCUS_SHIFT), WMEvent(window=windows[0], event_type=WMEventType.FOCUS_SHIFT), ] | assert | collection | tests/test_compat.py | test_display_handler_handles_focus_shifts | 30 | null | |
fennerm/flashfocus | import os
import socket
import pytest
from flashfocus.sockets import (
get_socket_address,
init_client_socket,
init_server_socket,
)
def test_init_client_socket_without_server() -> None:
with pytest.raises(SystemExit) as error:
init_client_socket()
assert "Error:" in | str(error.value) | assert | func_call | tests/test_sockets.py | test_init_client_socket_without_server | 30 | null | |
fennerm/flashfocus | from __future__ import annotations
import pytest
from flashfocus.compat import DisplayHandler, Window, get_workspace
from flashfocus.display import WMEvent, WMEventType
from flashfocus.errors import WMError
from tests.compat import change_focus, set_fullscreen, unset_fullscreen
from tests.helpers import new_window_ses... | should_be_equal | assert | variable | tests/test_compat.py | test_window_equality | 41 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
import pytest
from pytest_mock import MockerFixture
from flashfocus.compat import Window
from flashfocus.flasher import Flasher
from tests.helpers import change_focus, new_watched_window, watching_windows
def test_flash(flasher: Flasher, window: Window) -> N... | pytest.approx(expected_opacity, 0.01) | assert | func_call | tests/test_flasher.py | test_flash | 19 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
import pytest
from pytest_mock import MockerFixture
from flashfocus.compat import Window
from flashfocus.flasher import Flasher
from tests.helpers import change_focus, new_watched_window, watching_windows
def test_flash(flasher: Flasher, window: Window) -> N... | expected_opacity) | pytest.approx | variable | tests/test_flasher.py | test_flash | 19 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
from unittest.mock import MagicMock, call
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.client import client_request_flash
from flashfocus.compat import Window
from flashfocus.display import WMEvent, WMEventType
from flashfocus.serv... | pytest.approx(1) | assert | func_call | tests/test_server.py | test_window_opacity_unset_on_shutdown | 90 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
from unittest.mock import MagicMock, call
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.client import client_request_flash
from flashfocus.compat import Window
from flashfocus.display import WMEvent, WMEventType
from flashfocus.serv... | expected_calls | assert | variable | tests/test_server.py | test_event_loop | 56 | null | |
fennerm/flashfocus | import os
import socket
import pytest
from flashfocus.sockets import (
get_socket_address,
init_client_socket,
init_server_socket,
)
def test_init_client_socket_without_server() -> None:
with pytest.raises( | SystemExit) | pytest.raises | variable | tests/test_sockets.py | test_init_client_socket_without_server | 28 | null | |
fennerm/flashfocus | from __future__ import annotations
from time import sleep
from unittest.mock import MagicMock, call
import pytest
from pytest_lazyfixture import lazy_fixture
from flashfocus.client import client_request_flash
from flashfocus.compat import Window
from flashfocus.display import WMEvent, WMEventType
from flashfocus.serv... | 0 | assert | numeric_literal | tests/test_server.py | test_flash_lone_windows_set_to_never_for_new_window | 145 | null | |
fennerm/flashfocus | import os
from pathlib import Path
from flashfocus.pid import determine_runtime_dir
def test_determine_runtime_dir_without_xdg() -> None:
del os.environ["XDG_RUNTIME_DIR"]
assert determine_runtime_dir() == | Path("/tmp") | assert | func_call | tests/test_pid.py | test_determine_runtime_dir_without_xdg | 15 | null | |
CursorTouch/Windows-MCP | import asyncio
from unittest.mock import AsyncMock
import pytest
from windows_mcp.analytics import with_analytics
class TestWithAnalytics:
async def test_error_still_tracks_duration(self):
mock_analytics = AsyncMock()
@with_analytics(mock_analytics, "test_tool")
async def failing_tool()... | RuntimeError) | pytest.raises | variable | tests/test_analytics.py | test_error_still_tracks_duration | TestWithAnalytics | 68 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
import pytest
import requests
from windows_mcp.auth.service import AuthClient, AuthError, MAX_RETRIES, RETRY_BACKOFF
class TestAuthClientProperties:
def test_repr_masks_key(self):
client = AuthClient(api_key="sk-wmcp-abcdefghijklmnopqrst", sandbox_id="sb-1")
... | r | assert | variable | tests/test_auth_service.py | test_repr_masks_key | TestAuthClientProperties | 44 | null |
CursorTouch/Windows-MCP | from windows_mcp.desktop.views import Browser, Status, Size, DesktopState
class TestSize:
def test_to_string_zero(self):
s = Size(width=0, height=0)
assert s.to_string() == | "(0,0)" | assert | string_literal | tests/test_desktop_views.py | test_to_string_zero | TestSize | 40 | null |
CursorTouch/Windows-MCP | from datetime import datetime
from windows_mcp.filesystem.views import File, Directory, format_size, MAX_READ_SIZE, MAX_RESULTS
class TestFormatSize:
def test_bytes(self):
assert format_size(0) == "0 B"
assert format_size(512) == | "512 B" | assert | string_literal | tests/test_filesystem_views.py | test_bytes | TestFormatSize | 9 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestScrollElementNode:
def test_to_row_with_base_index(self, sample_scroll_element_node):
row = sample_scroll_element_node.to_row(index=0, base_index=5)
... | 5 | assert | numeric_literal | tests/test_tree_views.py | test_to_row_with_base_index | TestScrollElementNode | 145 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestBoundingBox:
def test_get_center_negative_coords(self):
bb = BoundingBox(left=-100, top=-200, right=100, bottom=0, width=200, height=200)
center = bb... | -100 | assert | numeric_literal | tests/test_tree_views.py | test_get_center_negative_coords | TestBoundingBox | 27 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
import pytest
import requests
from windows_mcp.auth.service import AuthClient, AuthError, MAX_RETRIES, RETRY_BACKOFF
class TestAuthError:
def test_with_status_code(self):
err = AuthError("unauthorized", status_code=401)
assert err.status_code == | 401 | assert | numeric_literal | tests/test_auth_service.py | test_with_status_code | TestAuthError | 18 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestBoundingBox:
def test_get_center_standard(self, sample_bounding_box):
center = sample_bounding_box.get_center()
assert center.x == | 200 | assert | numeric_literal | tests/test_tree_views.py | test_get_center_standard | TestBoundingBox | 14 | null |
CursorTouch/Windows-MCP | import asyncio
from unittest.mock import AsyncMock
import pytest
from windows_mcp.analytics import with_analytics
class TestWithAnalytics:
async def test_success_path(self):
mock_analytics = AsyncMock()
@with_analytics(mock_analytics, "test_tool")
async def my_tool():
return ... | "test_tool" | assert | string_literal | tests/test_analytics.py | test_success_path | TestWithAnalytics | 21 | null |
CursorTouch/Windows-MCP | from windows_mcp.desktop.views import Browser, Status, Size, DesktopState
class TestBrowser:
def test_has_process_unknown(self):
assert Browser.has_process("notepad.exe") is | False | assert | bool_literal | tests/test_desktop_views.py | test_has_process_unknown | TestBrowser | 19 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestScrollElementNode:
def test_to_row_with_base_index(self, sample_scroll_element_node):
row = sample_scroll_element_node.to_row(index=0, base_index=5)
a... | False | assert | bool_literal | tests/test_tree_views.py | test_to_row_with_base_index | TestScrollElementNode | 150 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from unittest.mock import MagicMock
import pytest
from windows_mcp.desktop.views import Size
from windows_mcp.tree.service import Tree
def tree_instance():
mock_desktop = MagicMock()
mock_desktop.get_screen_size.return_value = Size(width=1920, height=1080)
return Tree(mo... | 50 | assert | numeric_literal | tests/test_tree_service.py | test_partial_overlap | TestIouBoundingBox | 58 | null |
CursorTouch/Windows-MCP | from windows_mcp.desktop.views import Browser, Status, Size, DesktopState
class TestStatus:
def test_enum_values(self):
assert Status.MAXIMIZED.value == "Maximized"
assert Status.MINIMIZED.value == | "Minimized" | assert | string_literal | tests/test_desktop_views.py | test_enum_values | TestStatus | 28 | null |
CursorTouch/Windows-MCP | from windows_mcp.desktop.views import Browser, Status, Size, DesktopState
class TestStatus:
def test_enum_values(self):
assert Status.MAXIMIZED.value == "Maximized"
assert Status.MINIMIZED.value == "Minimized"
assert Status.NORMAL.value == | "Normal" | assert | string_literal | tests/test_desktop_views.py | test_enum_values | TestStatus | 29 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestBoundingBox:
def test_get_center_zero_size(self):
bb = BoundingBox(left=50, top=50, right=50, bottom=50, width=0, height=0)
center = bb.get_center()
... | 50 | assert | numeric_literal | tests/test_tree_views.py | test_get_center_zero_size | TestBoundingBox | 20 | null |
CursorTouch/Windows-MCP | import asyncio
from unittest.mock import AsyncMock
import pytest
from windows_mcp.analytics import with_analytics
class TestWithAnalytics:
async def test_success_path(self):
mock_analytics = AsyncMock()
@with_analytics(mock_analytics, "test_tool")
async def my_tool():
return ... | "result" | assert | string_literal | tests/test_analytics.py | test_success_path | TestWithAnalytics | 18 | null |
CursorTouch/Windows-MCP | import os
import pytest
from windows_mcp.filesystem.service import (
read_file,
write_file,
copy_path,
move_path,
delete_path,
list_directory,
search_files,
get_file_info,
)
class TestCopyPath:
def test_copy_file(self, tmp_path):
src = tmp_path / "src.txt"
src.writ... | "data" | assert | string_literal | tests/test_filesystem_service.py | test_copy_file | TestCopyPath | 68 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestTreeElementNode:
def test_update_from_node(self, sample_tree_element_node):
target = TreeElementNode(
bounding_box=BoundingBox(left=0, top=0, rig... | "" | assert | string_literal | tests/test_tree_views.py | test_update_from_node | TestTreeElementNode | 134 | null |
CursorTouch/Windows-MCP | from datetime import datetime
from windows_mcp.filesystem.views import File, Directory, format_size, MAX_READ_SIZE, MAX_RESULTS
class TestFormatSize:
def test_bytes(self):
assert format_size(0) == | "0 B" | assert | string_literal | tests/test_filesystem_views.py | test_bytes | TestFormatSize | 8 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from unittest.mock import MagicMock
import pytest
from windows_mcp.desktop.views import Size
from windows_mcp.tree.service import Tree
def tree_instance():
mock_desktop = MagicMock()
mock_desktop.get_screen_size.return_value = Size(width=1920, height=1080)
return Tree(mo... | 150 | assert | numeric_literal | tests/test_tree_service.py | test_partial_overlap | TestIouBoundingBox | 56 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestBoundingBox:
def test_from_bounding_rectangle(self):
mock_rect = SimpleNamespace(left=10, top=20, right=110, bottom=70)
mock_rect.width = lambda: 100... | 70 | assert | numeric_literal | tests/test_tree_views.py | test_from_bounding_rectangle | TestBoundingBox | 47 | null |
CursorTouch/Windows-MCP | from windows_mcp.desktop.views import Browser, Status, Size, DesktopState
class TestDesktopState:
def test_windows_to_string_empty(self):
ds = DesktopState(
active_desktop={"name": "Desktop 1"},
all_desktops=[],
active_window=None,
windows=[],
)
... | "No windows found" | assert | string_literal | tests/test_desktop_views.py | test_windows_to_string_empty | TestDesktopState | 80 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from unittest.mock import MagicMock
import pytest
from windows_mcp.desktop.views import Size
from windows_mcp.tree.service import Tree
def tree_instance():
mock_desktop = MagicMock()
mock_desktop.get_screen_size.return_value = Size(width=1920, height=1080)
return Tree(mo... | 1060 | assert | numeric_literal | tests/test_tree_service.py | test_screen_clamping | TestIouBoundingBox | 74 | null |
CursorTouch/Windows-MCP | import asyncio
from unittest.mock import AsyncMock
import pytest
from windows_mcp.analytics import with_analytics
class TestWithAnalytics:
async def test_no_analytics_instance(self):
@with_analytics(None, "test_tool")
async def my_tool():
return 42
result = await my_tool()
... | 42 | assert | numeric_literal | tests/test_analytics.py | test_no_analytics_instance | TestWithAnalytics | 45 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestBoundingBox:
def test_from_bounding_rectangle(self):
mock_rect = SimpleNamespace(left=10, top=20, right=110, bottom=70)
mock_rect.width = lambda: 100... | 10 | assert | numeric_literal | tests/test_tree_views.py | test_from_bounding_rectangle | TestBoundingBox | 44 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
from types import SimpleNamespace
import pytest
from windows_mcp.desktop.service import Desktop
def desktop():
with patch.object(Desktop, '__init__', lambda self: None):
return Desktop()
class TestGetSystemInfo:
def test_returns_all_sections(self, desktop):... | result | assert | variable | tests/test_system_info.py | test_returns_all_sections | TestGetSystemInfo | 50 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestTreeElementNode:
def test_update_from_node(self, sample_tree_element_node):
target = TreeElementNode(
bounding_box=BoundingBox(left=0, top=0, rig... | "OK" | assert | string_literal | tests/test_tree_views.py | test_update_from_node | TestTreeElementNode | 131 | null |
CursorTouch/Windows-MCP | from windows_mcp.desktop.views import Browser, Status, Size, DesktopState
class TestSize:
def test_to_string_standard(self):
s = Size(width=1920, height=1080)
assert s.to_string() == | "(1920,1080)" | assert | string_literal | tests/test_desktop_views.py | test_to_string_standard | TestSize | 36 | null |
CursorTouch/Windows-MCP | from windows_mcp.desktop.views import Browser, Status, Size, DesktopState
class TestDesktopState:
def test_active_desktop_to_string(self, sample_desktop_state):
result = sample_desktop_state.active_desktop_to_string()
assert "Desktop 1" in | result | assert | variable | tests/test_desktop_views.py | test_active_desktop_to_string | TestDesktopState | 52 | null |
CursorTouch/Windows-MCP | import os
import pytest
from windows_mcp.filesystem.service import (
read_file,
write_file,
copy_path,
move_path,
delete_path,
list_directory,
search_files,
get_file_info,
)
class TestWriteFile:
def test_creates_parent_dirs(self, tmp_path):
f = tmp_path / "a" / "b" / "c.t... | "deep" | assert | string_literal | tests/test_filesystem_service.py | test_creates_parent_dirs | TestWriteFile | 58 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestScrollElementNode:
def test_to_row_with_base_index(self, sample_scroll_element_node):
row = sample_scroll_element_node.to_row(index=0, base_index=5)
a... | 0.0 | assert | numeric_literal | tests/test_tree_views.py | test_to_row_with_base_index | TestScrollElementNode | 151 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
import pytest
import requests
from windows_mcp.auth.service import AuthClient, AuthError, MAX_RETRIES, RETRY_BACKOFF
class TestAuthError:
def test_message(self):
err = AuthError("something failed")
assert str(err) == "something failed"
assert err... | None | assert | none_literal | tests/test_auth_service.py | test_message | TestAuthError | 14 | null |
CursorTouch/Windows-MCP | import asyncio
from unittest.mock import AsyncMock
import pytest
from windows_mcp.analytics import with_analytics
class TestWithAnalytics:
async def test_error_path(self):
mock_analytics = AsyncMock()
@with_analytics(mock_analytics, "test_tool")
async def failing_tool():
rai... | ValueError, match="something broke") | pytest.raises | complex_expr | tests/test_analytics.py | test_error_path | TestWithAnalytics | 32 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
import pytest
import requests
from windows_mcp.auth.service import AuthClient, AuthError, MAX_RETRIES, RETRY_BACKOFF
class TestAuthenticate:
@patch("windows_mcp.auth.service.time.sleep")
@patch("windows_mcp.auth.service.requests.post")
def test_backoff_timing(s... | RETRY_BACKOFF) | assert_* | variable | tests/test_auth_service.py | test_backoff_timing | TestAuthenticate | 177 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestBoundingBox:
def test_get_center_standard(self, sample_bounding_box):
center = sample_bounding_box.get_center()
assert center.x == 200
assert... | 100 | assert | numeric_literal | tests/test_tree_views.py | test_get_center_standard | TestBoundingBox | 15 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
import pytest
import requests
from windows_mcp.auth.service import AuthClient, AuthError, MAX_RETRIES, RETRY_BACKOFF
class TestAuthenticate:
@patch("windows_mcp.auth.service.time.sleep")
@patch("windows_mcp.auth.service.requests.post")
def test_backoff_timing(s... | AuthError) | pytest.raises | variable | tests/test_auth_service.py | test_backoff_timing | TestAuthenticate | 172 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
import pytest
import requests
from windows_mcp.auth.service import AuthClient, AuthError, MAX_RETRIES, RETRY_BACKOFF
class TestAuthenticate:
@patch("windows_mcp.auth.service.time.sleep")
@patch("windows_mcp.auth.service.requests.post")
def test_retry_then_succe... | 2 | assert | numeric_literal | tests/test_auth_service.py | test_retry_then_success | TestAuthenticate | 164 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestTreeElementNode:
def test_update_from_node(self, sample_tree_element_node):
target = TreeElementNode(
bounding_box=BoundingBox(left=0, top=0, rig... | True | assert | bool_literal | tests/test_tree_views.py | test_update_from_node | TestTreeElementNode | 137 | null |
CursorTouch/Windows-MCP | import asyncio
from unittest.mock import AsyncMock
import pytest
from windows_mcp.analytics import with_analytics
class TestWithAnalytics:
async def test_success_path(self):
mock_analytics = AsyncMock()
@with_analytics(mock_analytics, "test_tool")
async def my_tool():
return ... | True | assert | bool_literal | tests/test_analytics.py | test_success_path | TestWithAnalytics | 22 | null |
CursorTouch/Windows-MCP | from datetime import datetime
from windows_mcp.filesystem.views import File, Directory, format_size, MAX_READ_SIZE, MAX_RESULTS
class TestDirectory:
def test_relative_path_override(self):
d = Directory(name="file.py", is_dir=False, size=100)
result = d.to_string(relative_path="sub/file.py")
... | 1 | assert | numeric_literal | tests/test_filesystem_views.py | test_relative_path_override | TestDirectory | 109 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestBoundingBox:
def test_get_center_negative_coords(self):
bb = BoundingBox(left=-100, top=-200, right=100, bottom=0, width=200, height=200)
center = bb... | 0 | assert | numeric_literal | tests/test_tree_views.py | test_get_center_negative_coords | TestBoundingBox | 26 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from unittest.mock import MagicMock
import pytest
from windows_mcp.desktop.views import Size
from windows_mcp.tree.service import Tree
def tree_instance():
mock_desktop = MagicMock()
mock_desktop.get_screen_size.return_value = Size(width=1920, height=1080)
return Tree(mo... | 200 | assert | numeric_literal | tests/test_tree_service.py | test_full_overlap | TestIouBoundingBox | 45 | null |
CursorTouch/Windows-MCP | import asyncio
from unittest.mock import AsyncMock
import pytest
from windows_mcp.analytics import with_analytics
class TestWithAnalytics:
async def test_duration_measurement(self):
mock_analytics = AsyncMock()
@with_analytics(mock_analytics, "test_tool")
async def slow_tool():
... | 50 | assert | numeric_literal | tests/test_analytics.py | test_duration_measurement | TestWithAnalytics | 58 | null |
CursorTouch/Windows-MCP | from windows_mcp.desktop.views import Browser, Status, Size, DesktopState
class TestBrowser:
def test_has_process_chrome(self):
assert Browser.has_process("chrome.exe") is | True | assert | bool_literal | tests/test_desktop_views.py | test_has_process_chrome | TestBrowser | 6 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from unittest.mock import MagicMock
import pytest
from windows_mcp.desktop.views import Size
from windows_mcp.tree.service import Tree
def tree_instance():
mock_desktop = MagicMock()
mock_desktop.get_screen_size.return_value = Size(width=1920, height=1080)
return Tree(mo... | "Taskbar" | assert | string_literal | tests/test_tree_service.py | test_shell_traywnd | TestAppNameCorrection | 22 | null |
CursorTouch/Windows-MCP | from unittest.mock import MagicMock, patch
import pytest
from windows_mcp.desktop.service import Desktop
def desktop():
with patch.object(Desktop, '__init__', lambda self: None):
d = Desktop()
d.execute_command = MagicMock()
return d
class TestRegistryGet:
def test_command_uses_ps_q... | cmd | assert | variable | tests/test_registry.py | test_command_uses_ps_quote | TestRegistryGet | 55 | null |
CursorTouch/Windows-MCP | from datetime import datetime
from windows_mcp.filesystem.views import File, Directory, format_size, MAX_READ_SIZE, MAX_RESULTS
class TestConstants:
def test_max_results(self):
assert MAX_RESULTS == | 500 | assert | numeric_literal | tests/test_filesystem_views.py | test_max_results | TestConstants | 31 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from unittest.mock import MagicMock
import pytest
from windows_mcp.desktop.views import Size
from windows_mcp.tree.service import Tree
def tree_instance():
mock_desktop = MagicMock()
mock_desktop.get_screen_size.return_value = Size(width=1920, height=1080)
return Tree(mo... | 100 | assert | numeric_literal | tests/test_tree_service.py | test_full_overlap | TestIouBoundingBox | 43 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from windows_mcp.tree.views import (
BoundingBox,
Center,
TreeElementNode,
TreeState,
)
class TestTreeElementNode:
def test_update_from_node(self, sample_tree_element_node):
target = TreeElementNode(
bounding_box=BoundingBox(left=0, top=0, rig... | "Alt+O" | assert | string_literal | tests/test_tree_views.py | test_update_from_node | TestTreeElementNode | 135 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from unittest.mock import MagicMock
import pytest
from windows_mcp.desktop.views import Size
from windows_mcp.tree.service import Tree
def tree_instance():
mock_desktop = MagicMock()
mock_desktop.get_screen_size.return_value = Size(width=1920, height=1080)
return Tree(mo... | 20 | assert | numeric_literal | tests/test_tree_service.py | test_screen_clamping | TestIouBoundingBox | 77 | null |
CursorTouch/Windows-MCP | from datetime import datetime
from windows_mcp.filesystem.views import File, Directory, format_size, MAX_READ_SIZE, MAX_RESULTS
class TestDirectory:
def test_default_size_zero(self):
d = Directory(name="test", is_dir=False)
assert d.size == | 0 | assert | numeric_literal | tests/test_filesystem_views.py | test_default_size_zero | TestDirectory | 113 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
import pytest
import requests
from windows_mcp.auth.service import AuthClient, AuthError, MAX_RETRIES, RETRY_BACKOFF
class TestAuthError:
def test_message(self):
err = AuthError("something failed")
assert str(err) == | "something failed" | assert | string_literal | tests/test_auth_service.py | test_message | TestAuthError | 12 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
import pytest
import requests
from windows_mcp.auth.service import AuthClient, AuthError, MAX_RETRIES, RETRY_BACKOFF
class TestAuthenticate:
@patch("windows_mcp.auth.service.time.sleep")
@patch("windows_mcp.auth.service.requests.post")
def test_5xx_retries(self... | 500 | assert | numeric_literal | tests/test_auth_service.py | test_5xx_retries | TestAuthenticate | 133 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
import pytest
import requests
from windows_mcp.auth.service import AuthClient, AuthError, MAX_RETRIES, RETRY_BACKOFF
class TestAuthenticate:
@patch("windows_mcp.auth.service.time.sleep")
@patch("windows_mcp.auth.service.requests.post")
def test_backoff_timing(s... | MAX_RETRIES - 1 | assert | complex_expr | tests/test_auth_service.py | test_backoff_timing | TestAuthenticate | 176 | null |
CursorTouch/Windows-MCP | import asyncio
from unittest.mock import AsyncMock
import pytest
from windows_mcp.analytics import with_analytics
class TestWithAnalytics:
async def test_success_path(self):
mock_analytics = AsyncMock()
@with_analytics(mock_analytics, "test_tool")
async def my_tool():
return ... | call_args[0][1] | assert | complex_expr | tests/test_analytics.py | test_success_path | TestWithAnalytics | 23 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
import pytest
import requests
from windows_mcp.auth.service import AuthClient, AuthError, MAX_RETRIES, RETRY_BACKOFF
class TestAuthenticate:
@patch("windows_mcp.auth.service.time.sleep")
@patch("windows_mcp.auth.service.requests.post")
def test_success(self, moc... | "tok-abc" | assert | string_literal | tests/test_auth_service.py | test_success | TestAuthenticate | 66 | null |
CursorTouch/Windows-MCP | from unittest.mock import patch, MagicMock
import pytest
import requests
from windows_mcp.auth.service import AuthClient, AuthError, MAX_RETRIES, RETRY_BACKOFF
class TestAuthenticate:
@patch("windows_mcp.auth.service.time.sleep")
@patch("windows_mcp.auth.service.requests.post")
def test_retry_then_succe... | "tok-retry" | assert | string_literal | tests/test_auth_service.py | test_retry_then_success | TestAuthenticate | 163 | null |
CursorTouch/Windows-MCP | from types import SimpleNamespace
from unittest.mock import MagicMock
import pytest
from windows_mcp.desktop.views import Size
from windows_mcp.tree.service import Tree
def tree_instance():
mock_desktop = MagicMock()
mock_desktop.get_screen_size.return_value = Size(width=1920, height=1080)
return Tree(mo... | "Desktop" | assert | string_literal | tests/test_tree_service.py | test_progman | TestAppNameCorrection | 19 | null |
lightning-power-users/node-launcher | from tempfile import NamedTemporaryFile
import pytest
from node_launcher.node_set.lib.configuration import Configuration
from node_launcher.node_set.lib.configuration_property import ConfigurationProperty
def configuration():
with NamedTemporaryFile(suffix='.conf', delete=True) as f:
name = f.name
co... | [ ConfigurationProperty('_new_1', 'a', 1), ConfigurationProperty('_new_2', 'a', 2) ] | assert | collection | tests/test_node_set/test_lib/test_configuration.py | test_append_configuration | TestConfiguration | 137 | null |
lightning-power-users/node-launcher | from tempfile import NamedTemporaryFile
import pytest
from node_launcher.node_set.lib.configuration import Configuration
from node_launcher.node_set.lib.configuration_property import ConfigurationProperty
def configuration():
with NamedTemporaryFile(suffix='.conf', delete=True) as f:
name = f.name
co... | False | assert | bool_literal | tests/test_node_set/test_lib/test_configuration.py | test_setitem_getitem_bool | TestConfiguration | 41 | null |
lightning-power-users/node-launcher | from tempfile import NamedTemporaryFile
import pytest
from node_launcher.node_set.lib.configuration import Configuration
from node_launcher.node_set.lib.configuration_property import ConfigurationProperty
def configuration():
with NamedTemporaryFile(suffix='.conf', delete=True) as f:
name = f.name
co... | [ ConfigurationProperty('_new_1', 'a', 'a'), ConfigurationProperty('_new_2', 'a', 2), ConfigurationProperty('_new_3', 'b', False) ] | assert | collection | tests/test_node_set/test_lib/test_configuration.py | test_edit_configuration | TestConfiguration | 111 | null |
lightning-power-users/node-launcher | import os
from os.path import isfile
from tempfile import NamedTemporaryFile
import pytest
from node_launcher.node_set.lib.configuration_file import ConfigurationFile
from node_launcher.node_set.lib.configuration_property import ConfigurationProperty
def configuration_file():
with NamedTemporaryFile(suffix='.con... | text | assert | variable | tests/test_node_set/test_lib/test_configuration_file.py | test_save | TestConfigurationFile | 54 | null |
lightning-power-users/node-launcher | from unittest.mock import MagicMock
from tempfile import NamedTemporaryFile
import pytest
from node_launcher.gui.menu.nodes_manage.manage_dialogs.configuration import ConfigurationDialog
from node_launcher.node_set.lib.configuration import Configuration
from node_launcher.node_set.lib.configuration_property import Co... | 'key' | assert | string_literal | tests/test_gui/test_menu/test_node_manager/test_configuration_dialog.py | test_update_key | TestConfigurationDialog | 50 | null |
lightning-power-users/node-launcher | from tempfile import NamedTemporaryFile
import pytest
from node_launcher.node_set.lib.configuration import Configuration
from node_launcher.node_set.lib.configuration_property import ConfigurationProperty
def configuration():
with NamedTemporaryFile(suffix='.conf', delete=True) as f:
name = f.name
co... | [ ConfigurationProperty('_new_1', 'a', 1) ] | assert | collection | tests/test_node_set/test_lib/test_configuration.py | test_append_configuration | TestConfiguration | 131 | null |
lightning-power-users/node-launcher | import os
import shutil
from shutil import make_archive
import pytest
from node_launcher.constants import IS_WINDOWS
from node_launcher.node_set.lib.constants import (
DEFAULT_COMPRESSED_SUFFIX,
DEFAULT_WINDOWS_COMPRESSED_SUFFIX
)
from node_launcher.node_set.lib.node_status import SoftwareStatus
from node_lau... | str(SoftwareStatus.INSTALLING_SOFTWARE) | assert | func_call | tests/test_node_set/test_lib/test_software.py | test_update_status | TestSoftware | 76 | null |
lightning-power-users/node-launcher | from unittest.mock import MagicMock
from tempfile import NamedTemporaryFile
import pytest
from node_launcher.gui.menu.nodes_manage.manage_dialogs.configuration import ConfigurationDialog
from node_launcher.node_set.lib.configuration import Configuration
from node_launcher.node_set.lib.configuration_property import Co... | 'test_key' | assert | string_literal | tests/test_gui/test_menu/test_node_manager/test_configuration_dialog.py | test_append_key_value | TestConfigurationDialog | 36 | null |
lightning-power-users/node-launcher | from tempfile import NamedTemporaryFile
import pytest
from node_launcher.node_set.lib.configuration import Configuration
from node_launcher.node_set.lib.configuration_property import ConfigurationProperty
def configuration():
with NamedTemporaryFile(suffix='.conf', delete=True) as f:
name = f.name
co... | [ ConfigurationProperty('_new_1', 'a', 'a'), ConfigurationProperty('_new_2', 'a', 1) ] | assert | collection | tests/test_node_set/test_lib/test_configuration.py | test_get_configurations_by_name | TestConfiguration | 70 | null |
lightning-power-users/node-launcher | import os
from tempfile import mkdtemp
import pytest
from node_launcher.node_set.lnd.lnd_configuration import LndConfiguration
from node_launcher.port_utilities import is_port_in_use
def lnd_configuration() -> LndConfiguration:
tmpdirname = mkdtemp()
os.rmdir(tmpdirname)
configuration_path = os.path.join... | True | assert | bool_literal | tests/test_node_set/test_lnd/test_lnd_configuration.py | test_bitcoin_file_changed | TestDirectoryConfiguration | 69 | null |
lightning-power-users/node-launcher | import pytest
from PySide6.QtCore import Qt
from PySide6.QtTest import QTest
from PySide6.QtWidgets import QApplication
from node_launcher.gui.components.copy_button import CopyButton
def copy_button() -> CopyButton:
copy_button = CopyButton(button_text='Test Me', copy_text='copy_this')
return copy_button
cl... | 'copy_this' | assert | string_literal | tests/test_gui/test_components/test_copy_button.py | test_copy_button | TestCopyButton | 18 | null |
lightning-power-users/node-launcher | import os
from tempfile import mkdtemp
import pytest
from node_launcher.node_set.lnd.lnd_configuration import LndConfiguration
from node_launcher.port_utilities import is_port_in_use
def lnd_configuration() -> LndConfiguration:
tmpdirname = mkdtemp()
os.rmdir(tmpdirname)
configuration_path = os.path.join... | 8338 | assert | numeric_literal | tests/test_node_set/test_lnd/test_lnd_configuration.py | test_bitcoin_file_changed | TestDirectoryConfiguration | 61 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.