Add end-to-end test for team sync
This commit is contained in:
parent
4055158fc4
commit
96b9d6b0cd
2 changed files with 16 additions and 2 deletions
|
@ -9,6 +9,8 @@ from data.users.teamsync import sync_team, sync_teams_to_groups
|
|||
from endpoints.test.fixtures import app, appconfig, database_uri, init_db_path, sqlitedb_file
|
||||
from util.names import parse_robot_username
|
||||
|
||||
from test.test_ldap import mock_ldap
|
||||
|
||||
_FAKE_AUTH = 'fake'
|
||||
|
||||
class FakeUsers(FederatedUsers):
|
||||
|
@ -218,3 +220,15 @@ def test_sync_teams_to_groups(app):
|
|||
|
||||
fourth_sync_info = model.team.get_team_sync_information('buynlarge', 'synced')
|
||||
assert fourth_sync_info.transaction_id != updated_sync_info.transaction_id
|
||||
|
||||
|
||||
@pytest.mark.parametrize('auth_system_builder', [
|
||||
mock_ldap,
|
||||
])
|
||||
def test_teamsync_end_to_end(auth_system_builder, app):
|
||||
# Assert the team has not yet been updated.
|
||||
sync_team_info = model.team.get_team_sync_information('buynlarge', 'synced')
|
||||
assert sync_team_info.last_updated is None
|
||||
|
||||
with auth_system_builder() as auth:
|
||||
assert sync_team(auth, sync_team_info)
|
||||
|
|
Reference in a new issue