forked from opendatahub-io/opendatahub-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_included_excluded_servers.py
More file actions
38 lines (32 loc) · 1.38 KB
/
test_included_excluded_servers.py
File metadata and controls
38 lines (32 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from typing import Self
import pytest
from tests.model_registry.utils import execute_get_command
from utilities.opendatahub_logger import get_logger
LOGGER = get_logger(name=__name__)
@pytest.mark.tier2
@pytest.mark.parametrize(
"mcp_included_excluded_configmap_patch",
[
pytest.param(
{"includedServers": ["weather-*", "file-*"], "excludedServers": ["file-*"]},
id="combined_include_exclude",
),
],
indirect=True,
)
@pytest.mark.usefixtures("mcp_included_excluded_configmap_patch")
class TestMCPServerIncludedExcludedFiltering:
"""Tests for includedServers/excludedServers glob pattern filtering (TC-LOAD-003, TC-LOAD-004, TC-LOAD-005)."""
def test_included_and_excluded_servers(
self: Self,
mcp_catalog_rest_urls: list[str],
model_registry_rest_headers: dict[str, str],
):
"""Verify includedServers are loaded and excludedServers are not (TC-LOAD-003, TC-LOAD-004, TC-LOAD-005)."""
response = execute_get_command(
url=f"{mcp_catalog_rest_urls[0]}mcp_servers",
headers=model_registry_rest_headers,
)
server_names = {server["name"] for server in response.get("items", [])}
assert "weather-api" in server_names, f"Expected 'weather-api' in {server_names}"
assert "file-manager" not in server_names, f"Expected 'file-manager' not in {server_names}"