17 lines
464 B
Python
17 lines
464 B
Python
import tempfile
|
|
from pathlib import Path
|
|
|
|
from beaver_gateway import config
|
|
|
|
|
|
def test_config_imports_sibling_modules():
|
|
root = Path(tempfile.mkdtemp(prefix="beaver-cfg-"))
|
|
(root / "policy_sibling.py").write_text("RULES = ('x',)\n")
|
|
(root / "config.py").write_text(
|
|
"from policy_sibling import RULES\n"
|
|
"assert RULES == ('x',)\n"
|
|
"gateway = Gateway()\n"
|
|
)
|
|
gw = config.load(root / "config.py")
|
|
assert gw.agents == []
|