Example #1
0
 def test_replace_events_writes_to_expected_file(self, mock_open):
     store = AuditLogCursorStore(PROFILE_NAME)
     store.replace_events("checkpointname", ["hash1", "hash2"])
     user_path = path.join(path.expanduser("~"), ".code42cli")
     expected_path = path.join(
         user_path,
         AUDIT_LOG_CHECKPOINT_FOLDER_NAME,
         PROFILE_NAME,
         "checkpointname_events",
     )
     mock_open.assert_called_once_with(expected_path, "w")
Example #2
0
 def test_replace_events_writes_expected_content(self, mock_open_events):
     store = AuditLogCursorStore(PROFILE_NAME)
     store.replace_events("checkpointname", ["hash1", "hash2"])
     user_path = path.join(path.expanduser("~"), ".code42cli")
     path.join(
         user_path,
         AUDIT_LOG_CHECKPOINT_FOLDER_NAME,
         PROFILE_NAME,
         "checkpointname_events",
     )
     mock_open_events.return_value.write.assert_called_once_with(
         '["hash1", "hash2"]')