'If the ``FlockerClient`` receives an unexpected HTTP response code it
returns a ``ResponseError`` failure.'

@capture_logging((lambda self, logger: assertHasAction(self, logger, _LOG_HTTP_REQUEST, False, dict(url='https://127.0.0.1:{}/v1/configuration/datasets'.format(self.port), method=u'POST', request_body=dict(primary=unicode(self.node_1.uuid), maximum_size=u'notint', metadata={})), {u'exception': u'flocker.apiclient._client.ResponseError'})))
def test_unexpected_error(self, logger):

    d = self.client.create_dataset(primary=self.node_1.uuid, maximum_size=u'notint')
    self.assertFailure(d, ResponseError)
    d.addCallback((lambda exc: self.assertEqual(exc.code, BAD_REQUEST)))
    return d
