Normalize line endings to LF across entire repository
Apply .gitattributes normalization to convert all CRLF line endings inherited from Windows-origin source files to Unix LF. 175 files, zero content changes.
This commit is contained in:
parent
696d2dd387
commit
bbdcb243dc
175 changed files with 56794 additions and 56794 deletions
|
|
@ -1,47 +1,47 @@
|
|||
"""Shared fixtures for skywalker-mcp tests."""
|
||||
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
import skywalker_mcp.server as srv
|
||||
from skywalker_mcp.mock_device import MockSkyWalker1
|
||||
from skywalker_mcp.server import DeviceBridge
|
||||
|
||||
|
||||
class MockContext:
|
||||
"""Minimal mock of FastMCP Context for direct tool function calls.
|
||||
|
||||
Provides the bridge via request_context.lifespan_context["bridge"],
|
||||
matching what _get_bridge(ctx) expects.
|
||||
"""
|
||||
|
||||
def __init__(self, bridge: DeviceBridge):
|
||||
self.request_context = MagicMock()
|
||||
self.request_context.lifespan_context = {"bridge": bridge}
|
||||
self._progress = []
|
||||
|
||||
async def report_progress(self, current, total):
|
||||
self._progress.append((current, total))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_device():
|
||||
"""Provide a fresh MockSkyWalker1 instance."""
|
||||
return MockSkyWalker1()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def bridge(mock_device):
|
||||
"""Provide a DeviceBridge wrapping the mock device."""
|
||||
b = DeviceBridge(mock_device)
|
||||
srv._bridge = b
|
||||
yield b
|
||||
b.cancel_motor_watchdog()
|
||||
srv._bridge = None
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def ctx(bridge):
|
||||
"""Provide a MockContext wired to the bridge."""
|
||||
return MockContext(bridge)
|
||||
"""Shared fixtures for skywalker-mcp tests."""
|
||||
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
import skywalker_mcp.server as srv
|
||||
from skywalker_mcp.mock_device import MockSkyWalker1
|
||||
from skywalker_mcp.server import DeviceBridge
|
||||
|
||||
|
||||
class MockContext:
|
||||
"""Minimal mock of FastMCP Context for direct tool function calls.
|
||||
|
||||
Provides the bridge via request_context.lifespan_context["bridge"],
|
||||
matching what _get_bridge(ctx) expects.
|
||||
"""
|
||||
|
||||
def __init__(self, bridge: DeviceBridge):
|
||||
self.request_context = MagicMock()
|
||||
self.request_context.lifespan_context = {"bridge": bridge}
|
||||
self._progress = []
|
||||
|
||||
async def report_progress(self, current, total):
|
||||
self._progress.append((current, total))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_device():
|
||||
"""Provide a fresh MockSkyWalker1 instance."""
|
||||
return MockSkyWalker1()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def bridge(mock_device):
|
||||
"""Provide a DeviceBridge wrapping the mock device."""
|
||||
b = DeviceBridge(mock_device)
|
||||
srv._bridge = b
|
||||
yield b
|
||||
b.cancel_motor_watchdog()
|
||||
srv._bridge = None
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def ctx(bridge):
|
||||
"""Provide a MockContext wired to the bridge."""
|
||||
return MockContext(bridge)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue