diff --git a/setup.cfg b/setup.cfg index 7f8e60f..da3855b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,8 +7,6 @@ cover-erase = 1 cover-package = sprockets.mixins.avro_publisher with-coverage = 1 verbosity = 2 -cover-html = 1 -cover-html-dir = build/coverage [upload_docs] upload-dir = build/sphinx/html diff --git a/sprockets/mixins/avro_publisher/__init__.py b/sprockets/mixins/avro_publisher/__init__.py index ec119d6..8fdbedb 100644 --- a/sprockets/mixins/avro_publisher/__init__.py +++ b/sprockets/mixins/avro_publisher/__init__.py @@ -11,6 +11,7 @@ Take note also of the required configurations in sprockets.mixins.amqp """ import io +import json import logging from sprockets.mixins import amqp, http @@ -123,7 +124,7 @@ class PublishingMixin(amqp.PublishingMixin, http.HTTPClientMixin): """ response = yield self.http_fetch(self._schema_url(message_type)) if response.ok: - raise gen.Return(response.body) + raise gen.Return(json.loads(response.raw.body.decode('utf-8'))) raise SchemaFetchError() def _schema_url(self, message_type): diff --git a/tests.py b/tests.py index cafd9e6..7f65546 100644 --- a/tests.py +++ b/tests.py @@ -62,6 +62,7 @@ class Test1RequestHandler(avro_publisher.PublishingMixin, web.RequestHandler): 'message_id': str(uuid.uuid4()), 'type': MESSAGE_TYPE}} + class Test2RequestHandler(Test1RequestHandler): def initialize(self):