def test_manage_new_model(): manage.set_model_repository(MODEL_REPOSITORY) manage.action_new(MODEL_NAME) home_dirs = list(pathlib.Path(MODEL_REPOSITORY).iterdir()) case = pathlib.Path(os.path.join(MODEL_REPOSITORY, MODEL_NAME)) assert case in home_dirs
def test_module_path_module_name(): """ Tests if importlib.module_import() works """ models_dir = MODEL_REPOSITORY manage.set_model_repository(models_dir) manage.action_new(MODEL_NAME) module_name = utils.module_path(MODEL_NAME, 0) assert module_name == (MODEL_NAME + '.dev')
def test_module_path_sys_append(): """ Tests if model directory is in sys.path to use importlib.module_import() for child model classes. """ models_dir = MODEL_REPOSITORY manage.set_model_repository(models_dir) manage.action_new(MODEL_NAME) utils.module_path(MODEL_NAME, 0) assert sys.path[0] == models_dir
def make_model(): manage.set_model_repository(MODEL_REPOSITORY) return manage.action_new(MODEL_NAME)