def test_bad_package_good_module(app_dir): dump_to_file(os.path.join(app_dir, '__init__.py'), "") dump_to_file(os.path.join(app_dir, 'app.py'), GOOD_APP_FILE) app = get_app(app_dir) assert app assert isinstance(app, Application)
def test_module_app(app_dir): """Tests that a package app is correctly loaded""" # prep dir dump_to_file(os.path.join(app_dir, 'app.py'), GOOD_APP_FILE) app = get_app(app_dir) assert app assert isinstance(app, Application)
def test_bad_module(app_dir): dump_to_file(os.path.join(app_dir, 'app.py'), BAD_APP_FILE) with pytest.raises(MindMeldImportError): get_app(app_dir)
def test_bad_package(app_dir): dump_to_file(os.path.join(app_dir, '__init__.py'), BAD_APP_FILE) with pytest.raises(MindMeldImportError): get_app(app_dir)
def test_no_files(app_dir): with pytest.raises(MindMeldImportError): get_app(app_dir)
def app(nlp): the_app = get_app(APP_PATH) the_app.lazy_init(nlp) return the_app