Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
SDESK-7441
  • Loading branch information
eos87 committed Nov 27, 2024
1 parent 12d4427 commit 94b9f09
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion superdesk/tests/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from datetime import datetime, timedelta, date
from os.path import basename
from re import findall
from unittest.mock import patch
from inspect import isawaitable
from urllib.parse import urlparse
from pathlib import Path

Expand Down Expand Up @@ -76,6 +76,9 @@ async def expect_status(response, code):


async def expect_status_in(response, codes):
if isawaitable(response):
response = await response

assert response.status_code in [
int(code) for code in codes
], "expected on of {expected}, got {code}, reason={reason}".format(
Expand Down Expand Up @@ -1445,6 +1448,11 @@ async def step_impl_then_get_nofield_in_path(context, path):

@then("we get existing resource")
@async_run_until_complete
async def step_impl_then_get_existing_resource(context):
# split into separate function so can be called/awaited independently
await step_impl_then_get_existing(context)


async def step_impl_then_get_existing(context):
await assert_200(context.response)
print("got", get_response_readable(await context.response.get_data()))
Expand Down

0 comments on commit 94b9f09

Please sign in to comment.