From 187a2f3f7ea3521dc8760897a71b4d47c1ef11c1 Mon Sep 17 00:00:00 2001 From: Maxime Alves LIRMM Date: Thu, 4 Aug 2022 19:14:36 +0200 Subject: [PATCH] [testing] fix test with MODULE attribute --- halfapi/testing/test_domain.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/halfapi/testing/test_domain.py b/halfapi/testing/test_domain.py index 48047db..da18b4a 100644 --- a/halfapi/testing/test_domain.py +++ b/halfapi/testing/test_domain.py @@ -14,9 +14,13 @@ from pprint import pprint import tempfile class TestDomain(TestCase): + @property + def module_name(self): + return getattr(self, 'MODULE', self.DOMAIN) + @property def router_module(self): - return '.'.join((self.DOMAIN, self.ROUTERS)) + return '.'.join((self.module_name, self.ROUTERS)) def setUp(self): # CLI @@ -54,7 +58,7 @@ class TestDomain(TestCase): 'name': self.DOMAIN, 'router': self.ROUTERS, 'acl': self.ACL, - 'module': self.MODULE, + 'module': self.module_name, 'prefix': False, 'enabled': True, 'config': { @@ -71,7 +75,7 @@ class TestDomain(TestCase): self.client = TestClient(self.halfapi.application) self.module = importlib.import_module( - getattr(self, 'MODULE', self.DOMAIN) + self.module_name )