예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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)
예제 #5
0
def test_no_files(app_dir):
    with pytest.raises(MindMeldImportError):
        get_app(app_dir)
예제 #6
0
def app(nlp):
    the_app = get_app(APP_PATH)
    the_app.lazy_init(nlp)
    return the_app