Unverified Commit 7cd9b161 authored by Amadej Kastelic's avatar Amadej Kastelic
Browse files
parent dea967a9
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -6,14 +6,14 @@

python3Packages.buildPythonApplication rec {
  pname = "mcp-nixos";
  version = "1.0.0";
  version = "1.0.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "utensils";
    repo = "mcp-nixos";
    tag = "v${version}";
    hash = "sha256-NwP+zM1VGLOzIm+mLZVK9/9ImFwuiWhRJ9QK3hGpQsY=";
    hash = "sha256-NFy38FrU4N+bk4qGyRnrpf2AaBrlQyC9SyRbCLm/d9Y=";
  };

  patches = [
@@ -25,10 +25,13 @@ python3Packages.buildPythonApplication rec {

  dependencies = with python3Packages; [
    beautifulsoup4
    fastmcp
    mcp
    requests
  ];

  pythonRelaxDeps = [ "fastmcp" ];

  nativeCheckInputs = with python3Packages; [
    anthropic
    pytestCheckHook
@@ -43,11 +46,11 @@ python3Packages.buildPythonApplication rec {

  disabledTestPaths = [
    # Require network access
    "tests/test_nixhub_evals.py"
    "tests/test_mcp_behavior_evals.py"
    "tests/test_option_info_improvements.py"
    "tests/test_nixhub.py"
    "tests/test_mcp_behavior.py"
    "tests/test_options.py"
    # Requires configured channels
    "tests/test_dynamic_channels.py"
    "tests/test_channels.py"
  ];

  pythonImportsCheck = [ "mcp_nixos" ];
+5 −8
Original line number Diff line number Diff line
diff --git a/tests/conftest.py b/tests/conftest.py
index 0a11295..1172182 100644
index baae124..2b4bf01 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -3,6 +3,30 @@
 import pytest  # pylint: disable=unused-import
@@ -1,6 +1,27 @@
 """Minimal test configuration for refactored MCP-NixOS."""
 
 
+import pytest
+@pytest.fixture(autouse=True)
+def mock_get_channels(monkeypatch):
+    """Mock get_channels function to return fixed channels for all tests."""
@@ -23,11 +24,7 @@ index 0a11295..1172182 100644
+    monkeypatch.setattr('mcp_nixos.server.get_channels', mock_channels)
+
+    # Also patch any imported references in test modules
+    monkeypatch.setattr('tests.test_channel_handling.get_channels', mock_channels)
+    monkeypatch.setattr('tests.test_dynamic_channels.get_channels', mock_channels, raising=False)
+    monkeypatch.setattr('tests.test_mcp_behavior_comprehensive.get_channels', mock_channels, raising=False)
+    monkeypatch.setattr('tests.test_real_world_scenarios.get_channels', mock_channels, raising=False)
+    monkeypatch.setattr('tests.test_server_comprehensive.get_channels', mock_channels, raising=False)
+    monkeypatch.setattr('tests.test_server.get_channels', mock_channels)
+
+
 def pytest_addoption(parser):