def test_state_delete(self):
        """Tests that State deletes addresses correctly."""
        self.mock_stream.send.return_value = self._make_future(
            message_type=Message.TP_STATE_DELETE_RESPONSE,
            content=TpStateDeleteResponse(
                status=TpStateDeleteResponse.OK,
                addresses=self.addresses).SerializeToString())

        self.context.delete_state(self.addresses)

        self.mock_stream.send.assert_called_with(
            Message.TP_STATE_DELETE_REQUEST,
            TpStateDeleteRequest(context_id=self.context_id,
                                 addresses=self.addresses).SerializeToString())
Exemple #2
0
 def create_delete_response(self, addresses):
     self._validate_addresses(addresses)
     return TpStateDeleteResponse(addresses=addresses)