def test_mask_customer_user_access_invitation_email(self): """Copies and masks a CustomerUserAccessInvitation instance.""" message = customer_user_access_invitation.CustomerUserAccessInvitation( email_address="*****@*****.**") copy = interceptor_module._mask_message(message, "REDACTED") self.assertIsInstance(copy, message.__class__) self.assertEqual(copy.email_address, "REDACTED")
def test_mask_search_change_event(self): """Masks ChangeEvent messages found on a SearchStream response.""" response = google_ads_service.SearchGoogleAdsStreamResponse() row = google_ads_service.GoogleAdsRow( change_event=change_event.ChangeEvent(user_email="*****@*****.**")) response.results.append(row) copy = interceptor_module._mask_message(response, "REDACTED") self.assertEqual(copy.results[0].change_event.user_email, "REDACTED")
def test_mask_create_customer_client_request(self): """Copies and masks a CreateCustomerClientRequest instance.""" request = customer_service.CreateCustomerClientRequest( email_address="*****@*****.**", ) copy = interceptor_module._mask_message(request, "REDACTED") self.assertIsInstance(copy, request.__class__) self.assertIsNot(copy, request) self.assertEqual(copy.email_address, "REDACTED")
def test_mask_places_location_feed_data(self): """Copies and masks a PlacesLocationFeedData instance.""" message = feed.Feed( places_location_feed_data=feed.Feed.PlacesLocationFeedData( email_address="*****@*****.**")) copy = interceptor_module._mask_message(message, "REDACTED") self.assertIsInstance(copy, message.__class__) self.assertIsNot(copy, message) self.assertEqual(copy.places_location_feed_data.email_address, "REDACTED")
def test_mask_customer_user_access(self): """Copies and masks a CustomerUserAccess message instance.""" customer_user_access_obj = customer_user_access.CustomerUserAccess( email_address="*****@*****.**", inviter_user_email_address="*****@*****.**", ) copy = interceptor_module._mask_message(customer_user_access_obj, "REDACTED") self.assertIsInstance(copy, customer_user_access_obj.__class__) self.assertIsNot(copy, customer_user_access_obj) self.assertEqual(copy.email_address, "REDACTED") self.assertEqual(copy.inviter_user_email_address, "REDACTED")
def test_mask_search_places_location_feed_data(self): """Masks Feed.places_location_feed_data on a SearchStream response.""" response = google_ads_service.SearchGoogleAdsStreamResponse() row = google_ads_service.GoogleAdsRow(feed=feed.Feed( places_location_feed_data=feed.Feed.PlacesLocationFeedData( email_address="*****@*****.**"))) response.results.append(row) copy = interceptor_module._mask_message(response, "REDACTED") self.assertEqual( copy.results[0].feed.places_location_feed_data.email_address, "REDACTED", )
def test_mask_search_google_ads_stream_response(self): """Copies and masks a SearchGoogleAdsStreamResponse message instance.""" response = google_ads_service.SearchGoogleAdsStreamResponse() row = google_ads_service.GoogleAdsRow( customer_user_access=customer_user_access.CustomerUserAccess( email_address="*****@*****.**")) response.results.append(row) copy = interceptor_module._mask_message(response, "REDACTED") self.assertIsInstance(copy, response.__class__) self.assertIsNot(response, copy) self.assertEqual(copy.results[0].customer_user_access.email_address, "REDACTED")
def test_mask_search_google_ads_response_protobuf(self): """Copies and masks a SearchGoogleAdsResponse message instance.""" response = google_ads_service.SearchGoogleAdsResponse() row = google_ads_service.GoogleAdsRow( customer_user_access=customer_user_access.CustomerUserAccess( email_address="*****@*****.**")) response.results.append(row) protobuf = util.convert_proto_plus_to_protobuf(response) copy = interceptor_module._mask_message(protobuf, "REDACTED") self.assertIsInstance(copy, protobuf.__class__) self.assertIsNot(protobuf, copy) self.assertEqual(copy.results[0].customer_user_access.email_address, "REDACTED")
def test_mask_mutate_customer_user_access_request(self): """Copies and masks a MutateCustomerUserAccessRequest instance.""" request = customer_user_access_service.MutateCustomerUserAccessRequest( operation=customer_user_access_service.CustomerUserAccessOperation( update=customer_user_access.CustomerUserAccess( email_address="*****@*****.**", inviter_user_email_address="*****@*****.**", ))) copy = interceptor_module._mask_message(request, "REDACTED") self.assertIsInstance(copy, request.__class__) self.assertIsNot(copy, request) self.assertEqual(copy.operation.update.email_address, "REDACTED") self.assertEqual(copy.operation.update.inviter_user_email_address, "REDACTED")