From 2954f3700b2b856df6010e3df01c61aa733d6941 Mon Sep 17 00:00:00 2001 From: Martin Rey Date: Tue, 13 Oct 2020 10:35:20 +0200 Subject: [PATCH] [misc] Sort imports with isort --- kibicara/config.py | 4 ++-- kibicara/email.py | 3 +-- kibicara/kibicara.py | 7 +++--- kibicara/model.py | 5 ++-- kibicara/platformapi.py | 8 +++---- kibicara/platforms/email/bot.py | 6 ++--- kibicara/platforms/email/mda.py | 11 +++++---- kibicara/platforms/email/model.py | 3 ++- kibicara/platforms/email/webapi.py | 23 ++++++++++--------- kibicara/platforms/telegram/bot.py | 11 +++++---- kibicara/platforms/telegram/model.py | 3 ++- kibicara/platforms/telegram/webapi.py | 13 ++++++----- kibicara/platforms/test/bot.py | 2 +- kibicara/platforms/test/model.py | 3 ++- kibicara/platforms/test/webapi.py | 12 ++++++---- kibicara/platforms/twitter/bot.py | 9 ++++---- kibicara/platforms/twitter/model.py | 3 ++- kibicara/platforms/twitter/webapi.py | 15 ++++++------ kibicara/webapi/__init__.py | 6 ++--- kibicara/webapi/admin.py | 23 ++++++++++--------- kibicara/webapi/hoods/__init__.py | 8 ++++--- kibicara/webapi/hoods/badwords.py | 11 +++++---- kibicara/webapi/hoods/triggers.py | 11 +++++---- tests/conftest.py | 6 +++-- .../tests_email/test_api_email_happy_path.py | 8 ++++--- tests/tests_telegram/conftest.py | 3 ++- .../test_api_telegram_create_bot.py | 3 ++- .../test_api_telegram_delete_bot.py | 3 ++- .../test_api_telegram_get_bots.py | 1 + tests/tests_twitter/conftest.py | 3 ++- .../test_api_twitter_create_bot.py | 3 ++- .../test_api_twitter_delete_bot.py | 3 ++- .../test_api_twitter_get_bots.py | 1 + 33 files changed, 134 insertions(+), 100 deletions(-) diff --git a/kibicara/config.py b/kibicara/config.py index 1ecc7c6..76ce55d 100644 --- a/kibicara/config.py +++ b/kibicara/config.py @@ -18,11 +18,11 @@ Example: """ from argparse import ArgumentParser +from sys import argv + from nacl.secret import SecretBox from nacl.utils import random from pytoml import load -from sys import argv - config = { 'database_connection': 'sqlite:////tmp/kibicara.sqlite', diff --git a/kibicara/email.py b/kibicara/email.py index 42bf034..65b5822 100644 --- a/kibicara/email.py +++ b/kibicara/email.py @@ -6,13 +6,12 @@ """ E-Mail handling. """ -from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart +from email.mime.text import MIMEText from logging import getLogger from smtplib import SMTP from socket import getfqdn - logger = getLogger(__name__) diff --git a/kibicara/kibicara.py b/kibicara/kibicara.py index 7f07555..d31e923 100644 --- a/kibicara/kibicara.py +++ b/kibicara/kibicara.py @@ -7,17 +7,18 @@ """ Entrypoint of Kibicara. """ from asyncio import run as asyncio_run +from logging import DEBUG, INFO, WARNING, basicConfig, getLogger + from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from fastapi.staticfiles import StaticFiles -from hypercorn.config import Config from hypercorn.asyncio import serve +from hypercorn.config import Config + from kibicara.config import args, config from kibicara.model import Mapping from kibicara.platformapi import Spawner from kibicara.webapi import router -from logging import basicConfig, DEBUG, getLogger, INFO, WARNING - logger = getLogger(__name__) diff --git a/kibicara/model.py b/kibicara/model.py index e7554a9..b3fe386 100644 --- a/kibicara/model.py +++ b/kibicara/model.py @@ -7,9 +7,10 @@ """ ORM Models for core. """ from databases import Database +from ormantic import Boolean, ForeignKey, Integer, Model, Text +from sqlalchemy import MetaData, create_engine + from kibicara.config import config -from ormantic import Boolean, Integer, ForeignKey, Model, Text -from sqlalchemy import create_engine, MetaData class Mapping: diff --git a/kibicara/platformapi.py b/kibicara/platformapi.py index a29f995..6bd8b65 100644 --- a/kibicara/platformapi.py +++ b/kibicara/platformapi.py @@ -6,12 +6,12 @@ """ API classes for implementing bots for platforms. """ -from asyncio import create_task, Queue -from enum import auto, Enum -from kibicara.model import BadWord, Trigger +from asyncio import Queue, create_task +from enum import Enum, auto from logging import getLogger -from re import search, IGNORECASE +from re import IGNORECASE, search +from kibicara.model import BadWord, Trigger logger = getLogger(__name__) diff --git a/kibicara/platforms/email/bot.py b/kibicara/platforms/email/bot.py index 8d75b0c..5e84e62 100644 --- a/kibicara/platforms/email/bot.py +++ b/kibicara/platforms/email/bot.py @@ -5,15 +5,15 @@ # # SPDX-License-Identifier: 0BSD +from logging import getLogger +from smtplib import SMTPException + from kibicara import email from kibicara.config import config from kibicara.model import Hood from kibicara.platformapi import Censor, Spawner from kibicara.platforms.email.model import Email, EmailSubscribers from kibicara.webapi.admin import to_token -from logging import getLogger -from smtplib import SMTPException - logger = getLogger(__name__) diff --git a/kibicara/platforms/email/mda.py b/kibicara/platforms/email/mda.py index c934c16..5f03f91 100644 --- a/kibicara/platforms/email/mda.py +++ b/kibicara/platforms/email/mda.py @@ -9,15 +9,16 @@ from asyncio import run as asyncio_run from email.parser import BytesParser from email.policy import default from email.utils import parseaddr -from fastapi import status -from kibicara.config import args, config -from kibicara.platforms.email.model import Email, EmailSubscribers from logging import getLogger -from ormantic import NoMatch from re import sub -from requests import post from sys import stdin +from fastapi import status +from ormantic import NoMatch +from requests import post + +from kibicara.config import args, config +from kibicara.platforms.email.model import Email, EmailSubscribers logger = getLogger(__name__) diff --git a/kibicara/platforms/email/model.py b/kibicara/platforms/email/model.py index a7fa87a..0f98a69 100644 --- a/kibicara/platforms/email/model.py +++ b/kibicara/platforms/email/model.py @@ -5,8 +5,9 @@ # # SPDX-License-Identifier: 0BSD +from ormantic import ForeignKey, Integer, Model, Text + from kibicara.model import Hood, Mapping -from ormantic import Integer, ForeignKey, Model, Text class Email(Model): diff --git a/kibicara/platforms/email/webapi.py b/kibicara/platforms/email/webapi.py index 2363b3e..4a91c9d 100644 --- a/kibicara/platforms/email/webapi.py +++ b/kibicara/platforms/email/webapi.py @@ -5,22 +5,23 @@ # # SPDX-License-Identifier: 0BSD -from fastapi import APIRouter, Depends, HTTPException, Response, status -from kibicara import email -from kibicara.platforms.email.bot import spawner -from kibicara.platforms.email.model import Email, EmailSubscribers -from kibicara.platformapi import Message -from kibicara.config import config -from kibicara.webapi.admin import from_token, to_token -from kibicara.webapi.hoods import get_hood, get_hood_unauthorized from logging import getLogger -from nacl import exceptions -from ormantic.exceptions import NoMatch from os import urandom -from pydantic import BaseModel, validator from smtplib import SMTPException from sqlite3 import IntegrityError +from fastapi import APIRouter, Depends, HTTPException, Response, status +from nacl import exceptions +from ormantic.exceptions import NoMatch +from pydantic import BaseModel, validator + +from kibicara import email +from kibicara.config import config +from kibicara.platformapi import Message +from kibicara.platforms.email.bot import spawner +from kibicara.platforms.email.model import Email, EmailSubscribers +from kibicara.webapi.admin import from_token, to_token +from kibicara.webapi.hoods import get_hood, get_hood_unauthorized logger = getLogger(__name__) diff --git a/kibicara/platforms/telegram/bot.py b/kibicara/platforms/telegram/bot.py index 58704bc..91f4886 100644 --- a/kibicara/platforms/telegram/bot.py +++ b/kibicara/platforms/telegram/bot.py @@ -3,14 +3,15 @@ # # SPDX-License-Identifier: 0BSD -from aiogram import Bot, Dispatcher, exceptions, types -from asyncio import gather, sleep, CancelledError -from kibicara.platformapi import Censor, Message, Spawner -from kibicara.platforms.telegram.model import Telegram, TelegramUser +from asyncio import CancelledError, gather, sleep from logging import getLogger -from ormantic.exceptions import NoMatch from sqlite3 import IntegrityError +from aiogram import Bot, Dispatcher, exceptions, types +from ormantic.exceptions import NoMatch + +from kibicara.platformapi import Censor, Message, Spawner +from kibicara.platforms.telegram.model import Telegram, TelegramUser logger = getLogger(__name__) diff --git a/kibicara/platforms/telegram/model.py b/kibicara/platforms/telegram/model.py index 932259a..fbe74d4 100644 --- a/kibicara/platforms/telegram/model.py +++ b/kibicara/platforms/telegram/model.py @@ -3,8 +3,9 @@ # # SPDX-License-Identifier: 0BSD +from ormantic import Boolean, ForeignKey, Integer, Model, Text + from kibicara.model import Hood, Mapping -from ormantic import Boolean, Integer, ForeignKey, Model, Text class Telegram(Model): diff --git a/kibicara/platforms/telegram/webapi.py b/kibicara/platforms/telegram/webapi.py index 84f8088..a197cf6 100644 --- a/kibicara/platforms/telegram/webapi.py +++ b/kibicara/platforms/telegram/webapi.py @@ -3,17 +3,18 @@ # # SPDX-License-Identifier: 0BSD -from aiogram.bot.api import check_token -from aiogram import exceptions -from fastapi import APIRouter, Depends, HTTPException, Response, status -from kibicara.platforms.telegram.bot import spawner -from kibicara.platforms.telegram.model import Telegram, TelegramUser -from kibicara.webapi.hoods import get_hood, get_hood_unauthorized from logging import getLogger from sqlite3 import IntegrityError + +from aiogram import exceptions +from aiogram.bot.api import check_token +from fastapi import APIRouter, Depends, HTTPException, Response, status from ormantic.exceptions import NoMatch from pydantic import BaseModel, validator +from kibicara.platforms.telegram.bot import spawner +from kibicara.platforms.telegram.model import Telegram, TelegramUser +from kibicara.webapi.hoods import get_hood, get_hood_unauthorized logger = getLogger(__name__) diff --git a/kibicara/platforms/test/bot.py b/kibicara/platforms/test/bot.py index b46fe2f..2942156 100644 --- a/kibicara/platforms/test/bot.py +++ b/kibicara/platforms/test/bot.py @@ -4,8 +4,8 @@ # # SPDX-License-Identifier: 0BSD -from kibicara.platforms.test.model import Test from kibicara.platformapi import Censor, Spawner +from kibicara.platforms.test.model import Test class TestBot(Censor): diff --git a/kibicara/platforms/test/model.py b/kibicara/platforms/test/model.py index 1921ebc..73dea0e 100644 --- a/kibicara/platforms/test/model.py +++ b/kibicara/platforms/test/model.py @@ -3,8 +3,9 @@ # # SPDX-License-Identifier: 0BSD +from ormantic import ForeignKey, Integer, Model + from kibicara.model import Hood, Mapping -from ormantic import Integer, ForeignKey, Model class Test(Model): diff --git a/kibicara/platforms/test/webapi.py b/kibicara/platforms/test/webapi.py index 655d955..125d31a 100644 --- a/kibicara/platforms/test/webapi.py +++ b/kibicara/platforms/test/webapi.py @@ -4,14 +4,16 @@ # # SPDX-License-Identifier: 0BSD +from sqlite3 import IntegrityError + from fastapi import APIRouter, Depends, HTTPException, Response, status -from kibicara.platforms.test.bot import spawner -from kibicara.platforms.test.model import Test -from kibicara.platformapi import Message -from kibicara.webapi.hoods import get_hood from ormantic.exceptions import NoMatch from pydantic import BaseModel -from sqlite3 import IntegrityError + +from kibicara.platformapi import Message +from kibicara.platforms.test.bot import spawner +from kibicara.platforms.test.model import Test +from kibicara.webapi.hoods import get_hood class BodyMessage(BaseModel): diff --git a/kibicara/platforms/twitter/bot.py b/kibicara/platforms/twitter/bot.py index bbad787..88b0d32 100644 --- a/kibicara/platforms/twitter/bot.py +++ b/kibicara/platforms/twitter/bot.py @@ -3,13 +3,14 @@ # # SPDX-License-Identifier: 0BSD -from asyncio import gather, sleep, CancelledError +from asyncio import CancelledError, gather, sleep +from logging import getLogger + +from peony import PeonyClient, exceptions + from kibicara.config import config from kibicara.platformapi import Censor, Message, Spawner from kibicara.platforms.twitter.model import Twitter -from logging import getLogger -from peony import PeonyClient, exceptions - logger = getLogger(__name__) diff --git a/kibicara/platforms/twitter/model.py b/kibicara/platforms/twitter/model.py index d1c3e56..70d8940 100644 --- a/kibicara/platforms/twitter/model.py +++ b/kibicara/platforms/twitter/model.py @@ -3,8 +3,9 @@ # # SPDX-License-Identifier: 0BSD +from ormantic import Boolean, ForeignKey, Integer, Model, Text + from kibicara.model import Hood, Mapping -from ormantic import Boolean, Integer, ForeignKey, Model, Text class Twitter(Model): diff --git a/kibicara/platforms/twitter/webapi.py b/kibicara/platforms/twitter/webapi.py index c02e9cf..6cc92c9 100644 --- a/kibicara/platforms/twitter/webapi.py +++ b/kibicara/platforms/twitter/webapi.py @@ -3,18 +3,19 @@ # # SPDX-License-Identifier: 0BSD +from logging import getLogger +from sqlite3 import IntegrityError + from fastapi import APIRouter, Depends, HTTPException, Response, status +from ormantic.exceptions import NoMatch +from peony.exceptions import NotAuthenticated +from peony.oauth_dance import get_access_token, get_oauth_token +from pydantic import BaseModel + from kibicara.config import config from kibicara.platforms.twitter.bot import spawner from kibicara.platforms.twitter.model import Twitter from kibicara.webapi.hoods import get_hood, get_hood_unauthorized -from logging import getLogger -from sqlite3 import IntegrityError -from ormantic.exceptions import NoMatch -from peony.oauth_dance import get_oauth_token, get_access_token -from peony.exceptions import NotAuthenticated -from pydantic import BaseModel - logger = getLogger(__name__) diff --git a/kibicara/webapi/__init__.py b/kibicara/webapi/__init__.py index 22b8ba5..18c5d2c 100644 --- a/kibicara/webapi/__init__.py +++ b/kibicara/webapi/__init__.py @@ -11,17 +11,17 @@ file to get included into the main application. """ from fastapi import APIRouter -from kibicara.platforms.test.webapi import router as test_router + +from kibicara.platforms.email.webapi import router as email_router from kibicara.platforms.telegram.webapi import router as telegram_router +from kibicara.platforms.test.webapi import router as test_router from kibicara.platforms.twitter.webapi import router as twitter_router from kibicara.platforms.twitter.webapi import twitter_callback_router -from kibicara.platforms.email.webapi import router as email_router from kibicara.webapi.admin import router as admin_router from kibicara.webapi.hoods import router as hoods_router from kibicara.webapi.hoods.badwords import router as badwords_router from kibicara.webapi.hoods.triggers import router as triggers_router - router = APIRouter() router.include_router(admin_router, prefix='/admin', tags=['admin']) hoods_router.include_router( diff --git a/kibicara/webapi/admin.py b/kibicara/webapi/admin.py index 55178a8..e534f0f 100644 --- a/kibicara/webapi/admin.py +++ b/kibicara/webapi/admin.py @@ -8,23 +8,24 @@ """ REST API endpoints for hood admins. """ from datetime import datetime, timedelta +from logging import getLogger +from pickle import dumps, loads +from smtplib import SMTPException +from sqlite3 import IntegrityError + from fastapi import APIRouter, Depends, HTTPException, Response, status from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm +from nacl.encoding import URLSafeBase64Encoder +from nacl.exceptions import CryptoError +from nacl.secret import SecretBox +from ormantic.exceptions import NoMatch +from passlib.hash import argon2 +from pydantic import BaseModel, validator + from kibicara import email from kibicara.config import config from kibicara.model import Admin, AdminHoodRelation, Hood from kibicara.webapi.utils import delete_hood -from logging import getLogger -from nacl.encoding import URLSafeBase64Encoder -from nacl.exceptions import CryptoError -from nacl.secret import SecretBox -from passlib.hash import argon2 -from ormantic.exceptions import NoMatch -from pickle import dumps, loads -from pydantic import BaseModel, validator -from smtplib import SMTPException -from sqlite3 import IntegrityError - logger = getLogger(__name__) diff --git a/kibicara/webapi/hoods/__init__.py b/kibicara/webapi/hoods/__init__.py index 0294573..a839979 100644 --- a/kibicara/webapi/hoods/__init__.py +++ b/kibicara/webapi/hoods/__init__.py @@ -6,14 +6,16 @@ """ REST API Endpoints for managing hoods. """ +from sqlite3 import IntegrityError + from fastapi import APIRouter, Depends, HTTPException, Response, status +from ormantic.exceptions import NoMatch +from pydantic import BaseModel + from kibicara.model import AdminHoodRelation, Hood, Trigger from kibicara.platforms.email.bot import spawner from kibicara.webapi.admin import get_admin from kibicara.webapi.utils import delete_hood -from ormantic.exceptions import NoMatch -from pydantic import BaseModel -from sqlite3 import IntegrityError class BodyHood(BaseModel): diff --git a/kibicara/webapi/hoods/badwords.py b/kibicara/webapi/hoods/badwords.py index 67caf21..15f1677 100644 --- a/kibicara/webapi/hoods/badwords.py +++ b/kibicara/webapi/hoods/badwords.py @@ -11,13 +11,16 @@ received message to be dropped by a censor. This provides a message filter custo by the hood admins. """ +from re import compile as regex_compile +from re import error as RegexError +from sqlite3 import IntegrityError + from fastapi import APIRouter, Depends, HTTPException, Response, status -from kibicara.model import BadWord -from kibicara.webapi.hoods import get_hood from ormantic.exceptions import NoMatch from pydantic import BaseModel -from re import compile as regex_compile, error as RegexError -from sqlite3 import IntegrityError + +from kibicara.model import BadWord +from kibicara.webapi.hoods import get_hood class BodyBadWord(BaseModel): diff --git a/kibicara/webapi/hoods/triggers.py b/kibicara/webapi/hoods/triggers.py index 8c13685..283e159 100644 --- a/kibicara/webapi/hoods/triggers.py +++ b/kibicara/webapi/hoods/triggers.py @@ -12,13 +12,16 @@ regular expressions otherwise it gets dropped by the censor. This provides a mes filter customizable by the hood admins. """ +from re import compile as regex_compile +from re import error as RegexError +from sqlite3 import IntegrityError + from fastapi import APIRouter, Depends, HTTPException, Response, status -from kibicara.model import Trigger -from kibicara.webapi.hoods import get_hood from ormantic.exceptions import NoMatch from pydantic import BaseModel -from re import compile as regex_compile, error as RegexError -from sqlite3 import IntegrityError + +from kibicara.model import Trigger +from kibicara.webapi.hoods import get_hood class BodyTrigger(BaseModel): diff --git a/tests/conftest.py b/tests/conftest.py index 3402e34..ae09d70 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4,13 +4,15 @@ # # SPDX-License-Identifier: 0BSD +from urllib.parse import urlparse + from fastapi import FastAPI, status from fastapi.testclient import TestClient +from pytest import fixture + from kibicara import email from kibicara.model import Mapping from kibicara.webapi import router -from pytest import fixture -from urllib.parse import urlparse @fixture(scope='module') diff --git a/tests/tests_email/test_api_email_happy_path.py b/tests/tests_email/test_api_email_happy_path.py index 5ee06f7..a1c1bd9 100644 --- a/tests/tests_email/test_api_email_happy_path.py +++ b/tests/tests_email/test_api_email_happy_path.py @@ -3,13 +3,15 @@ # # SPDX-License-Identifier: 0BSD -from fastapi import status -from kibicara.webapi.admin import to_token import subprocess -from pytest import skip from re import findall from urllib.parse import urlparse +from fastapi import status +from pytest import skip + +from kibicara.webapi.admin import to_token + def test_email_subscribe_unsubscribe(client, hood_id, receive_email): response = client.post( diff --git a/tests/tests_telegram/conftest.py b/tests/tests_telegram/conftest.py index d8f8632..4e29863 100644 --- a/tests/tests_telegram/conftest.py +++ b/tests/tests_telegram/conftest.py @@ -3,9 +3,10 @@ # # SPDX-License-Identifier: 0BSD +from pytest import fixture + from kibicara.model import Hood from kibicara.platforms.telegram.model import Telegram -from pytest import fixture @fixture(scope='function') diff --git a/tests/tests_telegram/test_api_telegram_create_bot.py b/tests/tests_telegram/test_api_telegram_create_bot.py index bc4e55f..85e39f8 100644 --- a/tests/tests_telegram/test_api_telegram_create_bot.py +++ b/tests/tests_telegram/test_api_telegram_create_bot.py @@ -4,9 +4,10 @@ # SPDX-License-Identifier: 0BSD from fastapi import status +from pytest import fixture, mark + from kibicara.platforms import telegram from kibicara.platforms.telegram.model import Telegram -from pytest import fixture, mark @fixture(scope='function') diff --git a/tests/tests_telegram/test_api_telegram_delete_bot.py b/tests/tests_telegram/test_api_telegram_delete_bot.py index 470c1ca..f87fbb0 100644 --- a/tests/tests_telegram/test_api_telegram_delete_bot.py +++ b/tests/tests_telegram/test_api_telegram_delete_bot.py @@ -4,10 +4,11 @@ # SPDX-License-Identifier: 0BSD from fastapi import status -from kibicara.platforms.telegram.model import Telegram, TelegramUser from ormantic.exceptions import NoMatch from pytest import mark, raises +from kibicara.platforms.telegram.model import Telegram, TelegramUser + @mark.parametrize('bot', [{'api_token': 'apitoken123', 'welcome_message': 'msg'}]) def test_telegram_delete_bot(client, event_loop, bot, telegram, auth_header): diff --git a/tests/tests_telegram/test_api_telegram_get_bots.py b/tests/tests_telegram/test_api_telegram_get_bots.py index 9038b9f..03b9bb1 100644 --- a/tests/tests_telegram/test_api_telegram_get_bots.py +++ b/tests/tests_telegram/test_api_telegram_get_bots.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: 0BSD from fastapi import status + from kibicara.model import Hood from kibicara.platforms.telegram.model import Telegram diff --git a/tests/tests_twitter/conftest.py b/tests/tests_twitter/conftest.py index 524c628..4bac1cd 100644 --- a/tests/tests_twitter/conftest.py +++ b/tests/tests_twitter/conftest.py @@ -3,9 +3,10 @@ # # SPDX-License-Identifier: 0BSD +from pytest import fixture + from kibicara.model import Hood from kibicara.platforms.twitter.model import Twitter -from pytest import fixture @fixture(scope='function') diff --git a/tests/tests_twitter/test_api_twitter_create_bot.py b/tests/tests_twitter/test_api_twitter_create_bot.py index 867ea0c..e58ecd9 100644 --- a/tests/tests_twitter/test_api_twitter_create_bot.py +++ b/tests/tests_twitter/test_api_twitter_create_bot.py @@ -4,10 +4,11 @@ # SPDX-License-Identifier: 0BSD from fastapi import status +from pytest import fixture, mark + from kibicara import config from kibicara.platforms import twitter from kibicara.platforms.twitter.model import Twitter -from pytest import fixture, mark @fixture(scope='function') diff --git a/tests/tests_twitter/test_api_twitter_delete_bot.py b/tests/tests_twitter/test_api_twitter_delete_bot.py index 7cd5b39..cc39e4f 100644 --- a/tests/tests_twitter/test_api_twitter_delete_bot.py +++ b/tests/tests_twitter/test_api_twitter_delete_bot.py @@ -4,10 +4,11 @@ # SPDX-License-Identifier: 0BSD from fastapi import status -from kibicara.platforms.twitter.model import Twitter from ormantic.exceptions import NoMatch from pytest import raises +from kibicara.platforms.twitter.model import Twitter + def test_twitter_delete_bot(client, event_loop, twitter, auth_header): response = client.delete( diff --git a/tests/tests_twitter/test_api_twitter_get_bots.py b/tests/tests_twitter/test_api_twitter_get_bots.py index c759cbc..16ef2cd 100644 --- a/tests/tests_twitter/test_api_twitter_get_bots.py +++ b/tests/tests_twitter/test_api_twitter_get_bots.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: 0BSD from fastapi import status + from kibicara.model import Hood from kibicara.platforms.twitter.model import Twitter