From d1ae549d48e514babd060aafbec6e5c846557193 Mon Sep 17 00:00:00 2001 From: Xyphuz Date: Wed, 18 May 2022 15:24:51 +0800 Subject: [PATCH] test: update test_extends.py --- tests/test_extends.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/test_extends.py b/tests/test_extends.py index 3cf9c2f..ce4662b 100644 --- a/tests/test_extends.py +++ b/tests/test_extends.py @@ -1,6 +1,19 @@ import pytest +from compose_viz.extends import Extends from compose_viz.service import Service -def test_parse_file(): +def test_extend_init(): + try: + Extends(service_name='frontend', from_file='tests/in/000001.yaml') + Extends(service_name='frontend') + + assert True + except: + assert False + + with pytest.raises(TypeError): + Extends(from_file='tests/in/000001.yaml') + +def test_service_init(): with pytest.raises(ValueError, match=r"Both image and extends are not defined in service 'frontend', aborting."): Service(name='frontend')