[testing] fix test with MODULE attribute

This commit is contained in:
Maxime Alves LIRMM 2022-08-04 19:14:36 +02:00
parent 671e03be79
commit 187a2f3f7e
1 changed files with 7 additions and 3 deletions

View File

@ -14,9 +14,13 @@ from pprint import pprint
import tempfile import tempfile
class TestDomain(TestCase): class TestDomain(TestCase):
@property
def module_name(self):
return getattr(self, 'MODULE', self.DOMAIN)
@property @property
def router_module(self): def router_module(self):
return '.'.join((self.DOMAIN, self.ROUTERS)) return '.'.join((self.module_name, self.ROUTERS))
def setUp(self): def setUp(self):
# CLI # CLI
@ -54,7 +58,7 @@ class TestDomain(TestCase):
'name': self.DOMAIN, 'name': self.DOMAIN,
'router': self.ROUTERS, 'router': self.ROUTERS,
'acl': self.ACL, 'acl': self.ACL,
'module': self.MODULE, 'module': self.module_name,
'prefix': False, 'prefix': False,
'enabled': True, 'enabled': True,
'config': { 'config': {
@ -71,7 +75,7 @@ class TestDomain(TestCase):
self.client = TestClient(self.halfapi.application) self.client = TestClient(self.halfapi.application)
self.module = importlib.import_module( self.module = importlib.import_module(
getattr(self, 'MODULE', self.DOMAIN) self.module_name
) )