Integration tests should use testcontainers to spin up a real MikroTik RouterOS container.
Guidelines:
- Use the
@pytest.mark.integration decorator. - Follow existing test structure and naming conventions.
- Test complete workflows (CRUD operations).
- Ensure proper cleanup for test isolation.
To run your integration tests, use:
pytest tests/integration/test_my_feature_integration.py -v
"""Integration tests for MikroTik my feature using testcontainers."""
import pytest
from mcp_mikrotik.scope.my_feature import (
mikrotik_create_my_resource,
mikrotik_list_my_resources
)
@pytest.mark.integration
class TestMikroTikMyFeatureIntegration:
def test_01_create_resource(self, mikrotik_container):
result = mikrotik_create_my_resource(
name="test_resource",
required_param="test_value"
)
assert "failed" not in result.lower()
assert "test_resource" in result
def test_02_list_resources(self, mikrotik_container):
result = mikrotik_list_my_resources()
assert "test_resource" in result