fix: test loop
fixture rename to event_loop
This commit is contained in:
parent
df2ef1adc0
commit
69141302cf
@ -37,14 +37,14 @@ class ArticleView(PydanticView):
|
|||||||
|
|
||||||
|
|
||||||
async def test_post_an_article_with_wrong_type_field_should_return_an_error_message(
|
async def test_post_an_article_with_wrong_type_field_should_return_an_error_message(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
|
|
||||||
client = await aiohttp_client(app)
|
client = await aiohttp_client(app)
|
||||||
resp = await client.post("/article", json={"name": "foo", "nb_page": "foo"})
|
resp = await client.post("/article", json={"name": "foo", "nb_page": "foo"})
|
||||||
a = await resp.text()
|
|
||||||
assert resp.status == 400
|
assert resp.status == 400
|
||||||
assert resp.content_type == "application/json"
|
assert resp.content_type == "application/json"
|
||||||
assert await resp.json() == [
|
assert await resp.json() == [
|
||||||
|
@ -29,7 +29,7 @@ class ArticleView(PydanticView):
|
|||||||
|
|
||||||
|
|
||||||
async def test_post_an_article_without_required_field_should_return_an_error_message(
|
async def test_post_an_article_without_required_field_should_return_an_error_message(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
@ -49,7 +49,7 @@ async def test_post_an_article_without_required_field_should_return_an_error_mes
|
|||||||
|
|
||||||
|
|
||||||
async def test_post_an_article_with_wrong_type_field_should_return_an_error_message(
|
async def test_post_an_article_with_wrong_type_field_should_return_an_error_message(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
@ -81,7 +81,7 @@ async def test_post_an_array_json_is_supported(aiohttp_client, event_loop):
|
|||||||
|
|
||||||
|
|
||||||
async def test_post_an_array_json_to_an_object_model_should_return_an_error(
|
async def test_post_an_array_json_to_an_object_model_should_return_an_error(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
@ -101,7 +101,7 @@ async def test_post_an_array_json_to_an_object_model_should_return_an_error(
|
|||||||
|
|
||||||
|
|
||||||
async def test_post_an_object_json_to_a_list_model_should_return_an_error(
|
async def test_post_an_object_json_to_a_list_model_should_return_an_error(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
|
@ -61,7 +61,7 @@ class ArticleViewWithSignatureGroup(PydanticView):
|
|||||||
|
|
||||||
|
|
||||||
async def test_get_article_without_required_header_should_return_an_error_message(
|
async def test_get_article_without_required_header_should_return_an_error_message(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
@ -81,7 +81,7 @@ async def test_get_article_without_required_header_should_return_an_error_messag
|
|||||||
|
|
||||||
|
|
||||||
async def test_get_article_with_wrong_header_type_should_return_an_error_message(
|
async def test_get_article_with_wrong_header_type_should_return_an_error_message(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
@ -101,7 +101,7 @@ async def test_get_article_with_wrong_header_type_should_return_an_error_message
|
|||||||
|
|
||||||
|
|
||||||
async def test_get_article_with_valid_header_should_return_the_parsed_type(
|
async def test_get_article_with_valid_header_should_return_the_parsed_type(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
@ -116,7 +116,7 @@ async def test_get_article_with_valid_header_should_return_the_parsed_type(
|
|||||||
|
|
||||||
|
|
||||||
async def test_get_article_with_valid_header_containing_hyphen_should_be_returned(
|
async def test_get_article_with_valid_header_containing_hyphen_should_be_returned(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
|
@ -11,7 +11,7 @@ class ArticleView(PydanticView):
|
|||||||
|
|
||||||
|
|
||||||
async def test_get_article_with_correct_path_parameters_should_return_parameters_in_path(
|
async def test_get_article_with_correct_path_parameters_should_return_parameters_in_path(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article/{author_id}/tag/{tag}/before/{date}", ArticleView)
|
app.router.add_view("/article/{author_id}/tag/{tag}/before/{date}", ArticleView)
|
||||||
@ -24,7 +24,7 @@ async def test_get_article_with_correct_path_parameters_should_return_parameters
|
|||||||
|
|
||||||
|
|
||||||
async def test_get_article_with_wrong_path_parameters_should_return_error(
|
async def test_get_article_with_wrong_path_parameters_should_return_error(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article/{author_id}/tag/{tag}/before/{date}", ArticleView)
|
app.router.add_view("/article/{author_id}/tag/{tag}/before/{date}", ArticleView)
|
||||||
|
@ -55,7 +55,7 @@ class ArticleViewWithPaginationGroup(PydanticView):
|
|||||||
|
|
||||||
|
|
||||||
async def test_get_article_without_required_qs_should_return_an_error_message(
|
async def test_get_article_without_required_qs_should_return_an_error_message(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
@ -75,7 +75,7 @@ async def test_get_article_without_required_qs_should_return_an_error_message(
|
|||||||
|
|
||||||
|
|
||||||
async def test_get_article_with_wrong_qs_type_should_return_an_error_message(
|
async def test_get_article_with_wrong_qs_type_should_return_an_error_message(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
@ -95,7 +95,7 @@ async def test_get_article_with_wrong_qs_type_should_return_an_error_message(
|
|||||||
|
|
||||||
|
|
||||||
async def test_get_article_with_valid_qs_should_return_the_parsed_type(
|
async def test_get_article_with_valid_qs_should_return_the_parsed_type(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
@ -114,7 +114,7 @@ async def test_get_article_with_valid_qs_should_return_the_parsed_type(
|
|||||||
|
|
||||||
|
|
||||||
async def test_get_article_with_valid_qs_and_omitted_optional_should_return_default_value(
|
async def test_get_article_with_valid_qs_and_omitted_optional_should_return_default_value(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
@ -133,7 +133,7 @@ async def test_get_article_with_valid_qs_and_omitted_optional_should_return_defa
|
|||||||
|
|
||||||
|
|
||||||
async def test_get_article_with_multiple_value_for_qs_age_must_failed(
|
async def test_get_article_with_multiple_value_for_qs_age_must_failed(
|
||||||
aiohttp_client, loop
|
aiohttp_client, event_loop
|
||||||
):
|
):
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
app.router.add_view("/article", ArticleView)
|
app.router.add_view("/article", ArticleView)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user