

def check_blueprint(self, keep=False):
    prefix = 'testapp.testblueprint.views'
    init_args = (() if keep else (prefix,))
    init_kwargs = ({
        'import_prefix': prefix,
    } if keep else {
        
    })
    app = create_test_app()
    views = LazyViews(app, 'testapp.views')
    views.add('/', 'home')
    views = LazyViews(**init_kwargs)
    blueprint = Blueprint('test_testblueprint', 'testapp.testblueprint', template_folder='templates')
    self.assertEqual(len(app.view_functions), 2)
    views.init_blueprint(blueprint, *init_args)
    views.add('/advanced', 'advanced', methods=('GET', 'POST'))
    views.add('/test', 'test')
    app.register_blueprint(blueprint, url_prefix='/test')
    self.assertEqual(len(app.view_functions), 4)
    with app.test_request_context():
        client = app.test_client()
        response = client.get(url_for('test_testblueprint.test'))
        self.assertEqual(response.status_code, 200)

dataset/ETHPy150Open playpauseandstop/Flask-LazyViews/testapp/testblueprint/tests.py TestLazyViews.check_blueprint/original