Coverage for src/meshadmin/cli/tests/conftest.py: 100%
14 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-25 08:49 +0200
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-25 08:49 +0200
1import pytest
2import yaml
5@pytest.fixture
6def temp_config_dir(tmp_path):
7 config_dir = tmp_path / "meshadmin"
8 config_dir.mkdir()
9 return config_dir
12@pytest.fixture
13def sample_context(temp_config_dir):
14 contexts = {
15 "test-context": {
16 "endpoint": "http://localhost:8000",
17 "interface": "nebula1",
18 "active": True,
19 }
20 }
21 contexts_file = temp_config_dir / "contexts.yaml"
22 with open(contexts_file, "w") as f:
23 yaml.dump(contexts, f)
24 return contexts