From b8027777d95350d6b90a3996bfb5967a63dae1f0 Mon Sep 17 00:00:00 2001 From: ldericher <40151420+ldericher@users.noreply.github.com> Date: Tue, 26 Oct 2021 16:19:33 +0200 Subject: [PATCH] Test coverage --- tests/test_config.py | 7 ++++++- tests/test_instance.py | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_config.py b/tests/test_config.py index 459079c..26fdd1d 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -157,9 +157,13 @@ class TestProject: c = KiwiConfig(projects=None) assert c == KiwiConfig(projects=[]) - assert c.projects == [] + with pytest.raises(ValueError) as exc_info: + c.get_project_config("invalid") + + assert str(exc_info.value) == "No Such Project" + def test_long(self): kiwi_dict = { "name": "project", @@ -171,6 +175,7 @@ class TestProject: assert len(c.projects) == 1 p = c.projects[0] assert p.name == "project" + assert p == c.get_project_config("project") assert not p.enabled assert p.override_storage is not None diff --git a/tests/test_instance.py b/tests/test_instance.py index 68f4280..68799a5 100644 --- a/tests/test_instance.py +++ b/tests/test_instance.py @@ -14,6 +14,10 @@ class TestDefault: assert p.name == "hello-world.project" + s = list(i.get_services(p.name)) + + assert len(s) == 5 + def test_empty(self): i = Instance()