pgadmin4/web/pgadmin/utils/dynamic_registry/tests/test_dynamic_registry.py
2022-01-04 13:54:25 +05:30

40 lines
1.1 KiB
Python

#######################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2022, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
from pgadmin.utils.route import BaseTestGenerator
from .registry import test_load_modules_based_registry, test_empty_registry, \
test_create_base_class, test_load_classname_registry
class TestDynamicRegistry(BaseTestGenerator):
scenarios = [
(
"Check empty registry",
dict(test=test_empty_registry),
),
(
'Load the registry based on the modules',
dict(test=test_load_modules_based_registry),
),
(
'Load the registry based on the name of the classes',
dict(test=test_load_classname_registry),
),
(
"When created a base class registry is initialized",
dict(test=test_create_base_class),
),
]
def runTest(self):
error = self.test()
if error is not None:
self.fail(error)