def test_is_proto_for_protobuf(self): fake_req = common_v1.InvokeRequest(method="test") test_data = GrpcAny() test_data.Pack(fake_req) resp = InvokeMethodResponse(data=test_data) self.assertTrue(resp.is_proto())
def test_is_proto_for_non_protobuf(self): test_data = GrpcAny(value=b'hello dapr') resp = InvokeMethodResponse(data=test_data, content_type='application/json') self.assertFalse(resp.is_proto())