Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Sagnard committed May 7, 2019
1 parent 0b75c40 commit f090f42
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion connexion/apis/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import logging
import pathlib
import sys
from enum import Enum

import six
from enum import Enum

from ..decorators.produces import NoContent
from ..exceptions import ResolverError
Expand Down
2 changes: 1 addition & 1 deletion connexion/apis/aiohttp_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from connexion.exceptions import OAuthProblem, OAuthScopeProblem
from connexion.handlers import AuthErrorHandler
from connexion.lifecycle import ConnexionRequest, ConnexionResponse
from connexion.utils import Jsonifier, is_json_mimetype, yamldumper
from connexion.utils import Jsonifier, yamldumper

try:
import ujson as json
Expand Down
11 changes: 5 additions & 6 deletions tests/aiohttp/test_get_response.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import asyncio
from aiohttp import web
import pytest
import json

import pytest
from aiohttp import web
from connexion.apis.aiohttp_api import AioHttpApi
from connexion.lifecycle import ConnexionResponse

Expand Down Expand Up @@ -83,7 +84,7 @@ def test_get_response_from_dict_json(api):
response = yield from api.get_response({'foo': 'bar'}, mimetype='application/json')
assert isinstance(response, web.Response)
assert response.status == 200
assert json.loads(response.body) == {"foo": "bar"}
assert json.loads(response.body.decode()) == {"foo": "bar"}
assert response.content_type == 'application/json'
assert dict(response.headers) == {'Content-Type': 'application/json; charset=utf-8'}

Expand All @@ -103,7 +104,7 @@ def test_get_response_binary_json(api):
response = yield from api.get_response(b'{"foo":"bar"}', mimetype='application/json')
assert isinstance(response, web.Response)
assert response.status == 200
assert json.loads(response.body) == {"foo": "bar"}
assert json.loads(response.body.decode()) == {"foo": "bar"}
assert response.content_type == 'application/json'
assert dict(response.headers) == {'Content-Type': 'application/json'}

Expand Down Expand Up @@ -146,5 +147,3 @@ def test_get_connexion_response_from_tuple(api):
assert response.body == b'foo'
assert response.content_type == 'text/plain'
assert dict(response.headers) == {'Content-Type': 'text/plain; charset=utf-8', 'X-header': 'value'}


0 comments on commit f090f42

Please sign in to comment.