def test_non_registered_topic(self): with self.assertRaises(NotImplementedError): self._servicier.OnTopicEvent( appcallback_v1.TopicEventRequest(pubsub_name='pubsub1', topic='topic_non_existed'), self.fake_context, )
def test_topic3_event_called_once(self): self._servicier.OnTopicEvent( appcallback_v1.TopicEventRequest(pubsub_name='pubsub1', topic='topic3'), self.fake_context, ) self._topic3_method.assert_called_once()
def test_topic3_event_response(self): response = self._servicier.OnTopicEvent( appcallback_v1.TopicEventRequest(pubsub_name='pubsub1', topic='topic3'), self.fake_context, ) self.assertIsInstance(response, appcallback_v1.TopicEventResponse) self.assertEqual( response.status, appcallback_v1.TopicEventResponse.TopicEventResponseStatus.SUCCESS)