Some checks failed
CI / test (push) Has been cancelled
- Simplified CI workflow to run only unit tests (42 tests pass) - Added conftest.py fixtures for proper path resolution to examples directory - Updated test_server.py and test_cli.py to use sample_spec_path fixture
21 lines
680 B
Python
21 lines
680 B
Python
import pytest
|
|
from pathlib import Path
|
|
|
|
|
|
def test_server_generation(sample_spec_path):
|
|
"""Test that mock server can be generated from OpenAPI spec."""
|
|
from mockapi.core.server import MockServerGenerator
|
|
|
|
generator = MockServerGenerator(str(sample_spec_path))
|
|
assert generator.spec_path == str(sample_spec_path)
|
|
assert generator.spec is not None
|
|
|
|
|
|
def test_server_get_endpoints(sample_spec_path):
|
|
"""Test that server generator extracts endpoints correctly."""
|
|
from mockapi.core.server import MockServerGenerator
|
|
|
|
generator = MockServerGenerator(str(sample_spec_path))
|
|
endpoints = generator.get_endpoints()
|
|
assert isinstance(endpoints, list)
|