Exemple #1
0
def load_app_test(app_started, app_tests_list):

    from base_common.importer import import_from_settings
    from base_common.importer import get_installed_apps
    from base_common.importer import get_app
    import base_tests.test_list
    imported_modules = []
    installed_apps = {}
    get_installed_apps(installed_apps)
    import_from_settings(imported_modules, app_started)

    _installed_app = get_app()
    _pm = _installed_app['pkg']
    import importlib
    app_tests = importlib.import_module(_pm.TESTS)

    for itest in app_tests.tests_included:

        app_test = getattr(app_tests, itest)

        if hasattr(base_tests.test_list, itest):
            log_info('OVERLOADING {}'.format(itest), '', None)
            setattr(base_tests.test_list, itest, app_test)

        else:
            log_info('LOADING {}'.format(itest), '', None)
            app_tests_list.append(app_test)
Exemple #2
0
def load_app_test(app_started, app_tests_list):

    from base_common.importer import import_from_settings
    from base_common.importer import get_installed_apps
    from base_common.importer import get_app
    import base_tests.test_list
    imported_modules = []
    installed_apps = {}
    get_installed_apps(installed_apps)
    import_from_settings(imported_modules, app_started)

    _installed_app = get_app()
    _pm = _installed_app['pkg']
    import importlib
    app_tests = importlib.import_module(_pm.TESTS)

    for itest in app_tests.tests_included:

        app_test = getattr(app_tests, itest)

        if hasattr(base_tests.test_list, itest):
            log_info('OVERLOADING {}'.format(itest), '', None)
            setattr(base_tests.test_list, itest, app_test)

        else:
            log_info('LOADING {}'.format(itest), '', None)
            app_tests_list.append(app_test)
Exemple #3
0
def load_app_test(app_started, app_tests_list, stage):
    from base_common.importer import import_from_settings
    from base_common.importer import get_installed_apps
    from base_common.importer import get_app
    import base_tests.test_list

    imported_modules = {}
    installed_apps = {}
    get_installed_apps(installed_apps)
    import_from_settings(imported_modules, app_started)

    _installed_app = get_app()
    _pm = _installed_app["pkg"]
    import importlib

    app_tests = importlib.import_module(_pm.TESTS)

    _last_stage = 0
    for itest in app_tests.tests_included:

        t_s = itest[0]
        t_n = itest[1]

        if t_s < _last_stage:
            log_warning("Exiting after: {}".format(t_n), "", None)
            break

        if t_s < stage:
            continue

        app_test = getattr(app_tests, t_n)

        if hasattr(base_tests.test_list, t_n):
            log_info("OVERLOADING {}".format(t_n), "", None)
            setattr(base_tests.test_list, t_n, app_test)

        else:
            log_info("LOADING {}".format(t_n), "", None)
            app_tests_list.append((app_test, t_s))

        _last_stage = t_s
Exemple #4
0
def load_app_test(app_started, app_tests_list, stage):
    from base_common.importer import import_from_settings
    from base_common.importer import get_installed_apps
    from base_common.importer import get_app
    import base_tests.test_list
    imported_modules = {}
    installed_apps = {}
    get_installed_apps(installed_apps)
    import_from_settings(imported_modules, app_started)

    _installed_app = get_app()
    _pm = _installed_app['pkg']
    import importlib
    app_tests = importlib.import_module(_pm.TESTS)

    _last_stage = 0
    for itest in app_tests.tests_included:

        t_s = itest[0]
        t_n = itest[1]

        if t_s < _last_stage:
            log_warning('Exiting after: {}'.format(t_n), '', None)
            break

        if t_s < stage:
            continue

        app_test = getattr(app_tests, t_n)

        if hasattr(base_tests.test_list, t_n):
            log_info('OVERLOADING {}'.format(t_n), '', None)
            setattr(base_tests.test_list, t_n, app_test)

        else:
            log_info('LOADING {}'.format(t_n), '', None)
            app_tests_list.append((app_test, t_s))

        _last_stage = t_s