def test_test_and_set_error(self):
        """ http post error request 101 """
        client = etcd.Client()
        response = FakeHTTPResponse(
            status=400,
            data='{"message": "message", "cause": "cause", "errorCode": 101}')
        client.http.request_encode_body = mock.Mock(return_value=response)
        payload = {'value': 'value', 'prevValue': 'oldValue', 'ttl': '60'}
        try:
            client.api_execute('/v2/keys/testkey', client._MPUT, payload)
            self.fail()
        except __HOLE__ as e:
            self.assertEquals('message : cause', str(e))
dataset/ETHPy150Open jplana/python-etcd/src/etcd/tests/unit/test_old_request.py/TestClientApiExecutor.test_test_and_set_error