Skip to content

Commit 89795a5

Browse files
committed
Fix imports in tests.
Signed-off-by: Yurii Serhiichuk <[email protected]>
1 parent 1ab9b63 commit 89795a5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

cloudevents/tests/test_http_conversions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
import pytest
2020

21-
from cloudevents.http import CloudEvent, from_dict, from_json, to_dict, to_json
21+
from cloudevents.conversion import to_dict, to_json
22+
from cloudevents.http import CloudEvent, from_dict, from_json
2223
from cloudevents.sdk.event.attribute import SpecVersion
2324

2425
test_data = json.dumps({"data-key": "val"})

cloudevents/tests/test_pydantic_conversions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
import pytest
2020

21-
from cloudevents.pydantic import CloudEvent, from_dict, from_json, to_json
21+
from cloudevents.conversion import to_json
22+
from cloudevents.pydantic import CloudEvent, from_dict, from_json
2223
from cloudevents.sdk.event.attribute import SpecVersion
2324

2425
test_data = json.dumps({"data-key": "val"})

cloudevents/tests/test_pydantic_events.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
from sanic import Sanic, response
2121

2222
import cloudevents.exceptions as cloud_exceptions
23-
from cloudevents.pydantic import CloudEvent, from_http, to_binary, to_structured
23+
from cloudevents.conversion import to_structured, to_binary
24+
from cloudevents.pydantic import CloudEvent, from_http
2425
from cloudevents.sdk import converters
2526
from cloudevents.sdk.converters.binary import is_binary
2627
from cloudevents.sdk.converters.structured import is_structured
@@ -81,7 +82,6 @@ async def echo(request):
8182
@pytest.mark.parametrize("body", invalid_cloudevent_request_body)
8283
def test_missing_required_fields_structured(body):
8384
with pytest.raises(cloud_exceptions.MissingRequiredFields):
84-
8585
_ = from_http(
8686
{"Content-Type": "application/cloudevents+json"}, json.dumps(body)
8787
)
@@ -186,7 +186,6 @@ def test_missing_ce_prefix_binary_event(specversion):
186186
"ce-specversion": specversion,
187187
}
188188
for key in headers:
189-
190189
# breaking prefix e.g. e-id instead of ce-id
191190
prefixed_headers[key[1:]] = headers[key]
192191

0 commit comments

Comments
 (0)