1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-22 12:53:00 +00:00
kiwi-scp/tests/test_project.py

33 lines
721 B
Python
Raw Normal View History

2021-10-22 15:50:26 +00:00
from pathlib import Path
from kiwi_scp.instance import Project
def test_example():
p = Project.from_directory(Path("example/hello-world.project"))
assert p.directory == Path("example/hello-world.project")
assert len(p.services) == 5
s = p.services[0]
assert s.name == "greeter"
assert len(s.configs) == 0
s = p.services[1]
assert s.name == "web"
assert len(s.configs) == 0
s = p.services[2]
assert s.name == "db"
assert len(s.configs) == 0
s = p.services[3]
assert s.name == "adminer"
assert len(s.configs) == 0
s = p.services[4]
assert s.name == "another-web"
assert len(s.configs) == 1
assert s.configs[0] == Path("html/index.html")