def test_set_retry(self, mock_communicator, mock_client, test_input,
                       expected):
        mock_communicator.send_message = MagicMock()
        module = IqModule(mock_communicator)
        module.get = MagicMock()

        client_entry_name = test_input[0]
        value = test_input[1]
        if not value:
            module.get.return_value = 1
            module.set_verify(self._CLIENT_NAME, client_entry_name)
        else:
            module.get.return_value = value
            module.set_verify(self._CLIENT_NAME, client_entry_name, value)

        assert module.get.call_args == call(self._CLIENT_NAME,
                                            client_entry_name,
                                            None,
                                            time_out=0.1)
    def test_set_retry_fail(self, mock_communicator, mock_client, test_input,
                            expected):
        mock_communicator.send_message = MagicMock()
        module = IqModule(mock_communicator)
        module.get = MagicMock()

        client_entry_name = test_input[0]
        value = test_input[1]
        if not value:
            module.get.return_value = 0
            success = module.set_verify(self._CLIENT_NAME, client_entry_name)
        else:
            module.get.return_value = None
            success = module.set_verify(self._CLIENT_NAME, client_entry_name,
                                        value)
            # two points of failure
            assert not success

            module.get.return_value = value - 1
            success = module.set_verify(self._CLIENT_NAME, client_entry_name,
                                        value)

        assert not success