Skip to content

Commit

Permalink
feat: add simple log to inform that sync has completed
Browse files Browse the repository at this point in the history
  • Loading branch information
gcharest authored May 22, 2024
1 parent 0cb9382 commit 9255edb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/modules/aws/identity_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def synchronize(**kwargs):
enable_membership_delete,
**kwargs,
)
logger.info("synchronize:Sync Completed")

return {
"users": users_sync_status,
Expand Down
10 changes: 7 additions & 3 deletions app/tests/modules/aws/test_sync_identity_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def test_synchronize_sync_users_and_groups_with_defaults(
logger_calls = [
call("synchronize:Found 1 Groups and 3 Users from Source"),
call("synchronize:Found 1 Groups and 3 Users from Target"),
call("synchronize:Sync Completed"),
]
assert mock_logger.info.call_args_list == logger_calls

Expand Down Expand Up @@ -292,9 +293,10 @@ def test_synchronize_sync_skip_users_if_false(
in mock_sync_identity_center_groups.call_args_list
)

assert mock_logger.info.call_count == 2
assert mock_logger.info.call_count == 3
logger_calls = [call("synchronize:Found 3 Groups and 6 Users from Source")]
logger_calls.append(call("synchronize:Found 3 Groups and 6 Users from Target"))
logger_calls.append(call("synchronize:Sync Completed"))
assert mock_logger.info.call_args_list == logger_calls


Expand Down Expand Up @@ -358,9 +360,10 @@ def test_synchronize_sync_skip_groups_false_if_false(
in mock_sync_identity_center_users.call_args_list
)

assert mock_logger.info.call_count == 2
assert mock_logger.info.call_count == 3
logger_calls = [call("synchronize:Found 3 Groups and 6 Users from Source")]
logger_calls.append(call("synchronize:Found 3 Groups and 6 Users from Target"))
logger_calls.append(call("synchronize:Sync Completed"))
assert mock_logger.info.call_args_list == logger_calls


Expand Down Expand Up @@ -420,9 +423,10 @@ def test_synchronize_sync_skip_users_and_groups_if_false(

assert mock_sync_identity_center_users.call_count == 0
assert mock_sync_identity_center_groups.call_count == 0
assert mock_logger.info.call_count == 2
assert mock_logger.info.call_count == 3
logger_calls = [call("synchronize:Found 3 Groups and 6 Users from Source")]
logger_calls.append(call("synchronize:Found 3 Groups and 6 Users from Target"))
logger_calls.append(call("synchronize:Sync Completed"))
assert mock_logger.info.call_args_list == logger_calls


Expand Down

0 comments on commit 9255edb

Please sign in to comment.