def test_init_app(app): gsa = GoogleServiceAccount('TEST') gsa.init_app(app) assert 'gsa' in app.extensions with app.app_context(): assert gsa._get_state() is not None
def test_multiple_extensions(app): app.config.update({ 'TEST2_PK_FILE': 'tests/data/test.p12', 'TEST2_PK_PASSWORD': '******', 'TEST2_EMAIL': '*****@*****.**', }) gsa1 = GoogleServiceAccount('TEST') gsa2 = GoogleServiceAccount('TEST2') gsa1.init_app(app) gsa2.init_app(app) assert len(app.extensions['gsa']) == 2
def test_multiple_apps(): app1 = make_app() app2 = make_app() gsa = GoogleServiceAccount('TEST') gsa.init_app(app1) gsa.init_app(app2)