Skip to content

Commit

Permalink
fix: imports in tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com>
  • Loading branch information
xSAVIKx committed Aug 14, 2022
1 parent 1ab9b63 commit 000a8fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cloudevents/tests/test_http_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import pytest

from cloudevents.http import CloudEvent, from_dict, from_json, to_dict, to_json
from cloudevents.conversion import to_dict, to_json
from cloudevents.http import CloudEvent, from_dict, from_json
from cloudevents.sdk.event.attribute import SpecVersion

test_data = json.dumps({"data-key": "val"})
Expand Down
3 changes: 2 additions & 1 deletion cloudevents/tests/test_pydantic_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import pytest

from cloudevents.pydantic import CloudEvent, from_dict, from_json, to_json
from cloudevents.conversion import to_json
from cloudevents.pydantic import CloudEvent, from_dict, from_json
from cloudevents.sdk.event.attribute import SpecVersion

test_data = json.dumps({"data-key": "val"})
Expand Down
5 changes: 2 additions & 3 deletions cloudevents/tests/test_pydantic_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
from sanic import Sanic, response

import cloudevents.exceptions as cloud_exceptions
from cloudevents.pydantic import CloudEvent, from_http, to_binary, to_structured
from cloudevents.conversion import to_structured, to_binary
from cloudevents.pydantic import CloudEvent, from_http
from cloudevents.sdk import converters
from cloudevents.sdk.converters.binary import is_binary
from cloudevents.sdk.converters.structured import is_structured
Expand Down Expand Up @@ -81,7 +82,6 @@ async def echo(request):
@pytest.mark.parametrize("body", invalid_cloudevent_request_body)
def test_missing_required_fields_structured(body):
with pytest.raises(cloud_exceptions.MissingRequiredFields):

_ = from_http(
{"Content-Type": "application/cloudevents+json"}, json.dumps(body)
)
Expand Down Expand Up @@ -186,7 +186,6 @@ def test_missing_ce_prefix_binary_event(specversion):
"ce-specversion": specversion,
}
for key in headers:

# breaking prefix e.g. e-id instead of ce-id
prefixed_headers[key[1:]] = headers[key]

Expand Down

0 comments on commit 000a8fb

Please sign in to comment.