def test_account_auth(account_credentials): email, password = account_credentials create_account(email, password) client = NylasTestClient(email, API_BASE) wait_for_auth(client) # wait for sync to start. tests rely on things setup at beginning # of sync (e.g. folder hierarchy) wait_for_sync_start(client)
def test_account_auth(account_credentials): email, password = account_credentials with session_scope() as db_session: create_account(db_session, email, password) client = InboxTestClient(email) wait_for_auth(client) # wait for sync to start. tests rely on things setup at beginning # of sync (e.g. folder hierarchy) wait_for_sync_start(client)
def test_account_create_should_fail(): """Test that creation fails with appropriate errors, as defined in the broken_credentials list. Credentials have the format: ({email, password}, error_type) e.g. ({'user': '******', 'password': '******'}, 'ConfigError') """ credentials = [((c['user'], c['password']), e) for (c, e) in broken_credentials] for ((email, password), error) in credentials: error_obj = getattr(errors, error) with session_scope() as db_session: with pytest.raises(error_obj): create_account(db_session, email, password)