def test_delete_device(self):
        channel = ChannelStub()
        client = iot_v1.DeviceManagerClient(channel=channel)

        # Setup Request
        name = client.device_path('[PROJECT]', '[LOCATION]', '[REGISTRY]',
                                  '[DEVICE]')

        client.delete_device(name)

        assert len(channel.requests) == 1
        expected_request = device_manager_pb2.DeleteDeviceRequest(name=name)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request
    def test_delete_device(self):
        channel = ChannelStub()
        patch = mock.patch("google.api_core.grpc_helpers.create_channel")
        with patch as create_channel:
            create_channel.return_value = channel
            client = iot_v1.DeviceManagerClient()

        # Setup Request
        name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]")

        client.delete_device(name)

        assert len(channel.requests) == 1
        expected_request = device_manager_pb2.DeleteDeviceRequest(name=name)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request