コード例 #1
0
    def test_delete_product_set(self):
        channel = ChannelStub()
        client = vision_v1.ProductSearchClient(channel=channel)

        # Setup Request
        name = client.product_set_path('[PROJECT]', '[LOCATION]',
                                       '[PRODUCT_SET]')

        client.delete_product_set(name)

        assert len(channel.requests) == 1
        expected_request = product_search_service_pb2.DeleteProductSetRequest(
            name=name)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request
コード例 #2
0
    def test_delete_product_set(self):
        channel = ChannelStub()
        patch = mock.patch("google.api_core.grpc_helpers.create_channel")
        with patch as create_channel:
            create_channel.return_value = channel
            client = vision_v1.ProductSearchClient()

        # Setup Request
        name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]")

        client.delete_product_set(name)

        assert len(channel.requests) == 1
        expected_request = product_search_service_pb2.DeleteProductSetRequest(name=name)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request