1 import pytest

2 import yaml

3

4

5@pytest.fixture

6 def temp_config_dir(tmp_path):

7 config_dir = tmp_path / "meshadmin"

8 config_dir.mkdir()

9 return config_dir

10

11

12@pytest.fixture

13 def 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