1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-24 13:43:01 +00:00
kiwi-scp/tests/test_instance.py
2021-11-03 17:35:36 +01:00

35 lines
862 B
Python

from pathlib import Path
from kiwi_scp.instance import Instance
class TestDefault:
def test_example(self):
i = Instance(Path("example"))
assert i.config is not None
assert len(i.config.projects) == 1
pc = i.config.projects[0]
assert pc.name == "hello-world.project"
p = i.get_project("hello-world.project")
assert p.directory == Path("example/hello-world.project")
assert i.get_project("nonexistent") is None
def test_empty(self):
i = Instance()
assert i.config is not None
assert len(i.config.projects) == 0
def test_no_such_dir(self):
nonexistent_path = Path("nonexistent")
i = Instance(nonexistent_path)
assert i.directory == nonexistent_path
assert i.config is not None
assert len(i.config.projects) == 0