Fix test_server.py to use sample_spec_path fixture
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-03-22 22:17:17 +00:00
parent 8f8da672df
commit 5a16a23fcb

View File

@@ -8,16 +8,13 @@ from mockapi.core.server_generator import MockServerGenerator
from mockapi.core.config import Config from mockapi.core.config import Config
SAMPLE_SPEC_PATH = "examples/petstore.yaml"
class TestMockServerIntegration: class TestMockServerIntegration:
"""Integration tests for mock server.""" """Integration tests for mock server."""
@pytest.fixture @pytest.fixture
def sample_spec(self): def sample_spec(self, sample_spec_path):
"""Load sample OpenAPI spec.""" """Load sample OpenAPI spec."""
loader = SpecLoader(SAMPLE_SPEC_PATH) loader = SpecLoader(sample_spec_path)
return loader.load() return loader.load()
@pytest.fixture @pytest.fixture
@@ -67,4 +64,4 @@ class TestMockServerIntegration:
assert len(schemas) > 0 assert len(schemas) > 0
assert "User" in schemas assert "User" in schemas
assert "Product" in schemas assert "Product" in schemas
assert "Order" in schemas assert "Order" in schemas