@record
    def test_message_text_fails(self):
        # Arrange
        qs2 = self._create_storage_service(QueueService, self.settings)
        qs2.encode_function = QueueMessageFormat.binary_base64encode
        qs2.decode_function = QueueMessageFormat.binary_base64decode

        queue_name = self._get_queue_reference()

        # Action.
        try:
            message = u'xyz'
            qs2.put_message(queue_name, message)
            self.fail('Passing text to binary encoder should fail.')
        except __HOLE__ as e:
            self.assertEqual(str(e), 'message should be of type bytes.')

        # Asserts
dataset/ETHPy150Open Azure/azure-storage-python/tests/test_queue_encodings.py/StorageQueueEncodingTest.test_message_text_fails