From 1a8071d8d6de1249dcf33d44c72b407e3362406d Mon Sep 17 00:00:00 2001 From: Cathy Hu Date: Sat, 12 Sep 2020 18:42:52 +0200 Subject: [PATCH] [tests] Fix formatting --- .../test_api_telegram_create_bot.py | 24 +++++++++++++++---- .../test_api_telegram_get_bots.py | 8 +++++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/tests/tests_telegram/test_api_telegram_create_bot.py b/tests/tests_telegram/test_api_telegram_create_bot.py index 826a1d3..24864f0 100644 --- a/tests/tests_telegram/test_api_telegram_create_bot.py +++ b/tests/tests_telegram/test_api_telegram_create_bot.py @@ -19,7 +19,13 @@ def disable_spawner(monkeypatch): @mark.parametrize('body', [{'api_token': 'string', 'welcome_message': 'string'}]) def test_telegram_create_bot( - event_loop, client, disable_spawner, hood_id, auth_header, monkeypatch, body, + event_loop, + client, + disable_spawner, + hood_id, + auth_header, + monkeypatch, + body, ): def check_token_mock(token): return True @@ -27,7 +33,9 @@ def test_telegram_create_bot( monkeypatch.setattr(telegram.webapi, 'check_token', check_token_mock) response = client.post( - f'/api/hoods/{hood_id}/telegram/', json=body, headers=auth_header, + f'/api/hoods/{hood_id}/telegram/', + json=body, + headers=auth_header, ) assert response.status_code == status.HTTP_201_CREATED bot_id = response.json()['id'] @@ -44,10 +52,18 @@ def test_telegram_create_bot( @mark.parametrize('body', [{'api_token': 'string', 'welcome_message': 'string'}]) def test_telegram_invalid_api_token( - event_loop, client, disable_spawner, hood_id, auth_header, monkeypatch, body, + event_loop, + client, + disable_spawner, + hood_id, + auth_header, + monkeypatch, + body, ): response = client.post( - f'/api/hoods/{hood_id}/telegram/', json=body, headers=auth_header, + f'/api/hoods/{hood_id}/telegram/', + json=body, + headers=auth_header, ) assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY diff --git a/tests/tests_telegram/test_api_telegram_get_bots.py b/tests/tests_telegram/test_api_telegram_get_bots.py index 2b7f9bf..8dfde5a 100644 --- a/tests/tests_telegram/test_api_telegram_get_bots.py +++ b/tests/tests_telegram/test_api_telegram_get_bots.py @@ -11,12 +11,16 @@ def test_telegram_get_bots(client, auth_header, event_loop, hood_id): hood = event_loop.run_until_complete(Hood.objects.get(id=hood_id)) telegram0 = event_loop.run_until_complete( Telegram.objects.create( - hood=hood, api_token='api_token123', welcome_message='welcome_message123', + hood=hood, + api_token='api_token123', + welcome_message='welcome_message123', ) ) telegram1 = event_loop.run_until_complete( Telegram.objects.create( - hood=hood, api_token='api_token456', welcome_message='welcome_message123', + hood=hood, + api_token='api_token456', + welcome_message='welcome_message123', ) ) response = client.get(