ticketfrei3/backend/tests/tests_telegram/conftest.py

22 lines
573 B
Python
Raw Normal View History

# Copyright (C) 2020 by Cathy Hu <cathy.hu@fau.de>
# Copyright (C) 2020 by Martin Rey <martin.rey@mailbox.org>
2023-03-19 18:03:25 +00:00
# Copyright (C) 2023 by Thomas Lindner <tom@dl6tom.de>
#
# SPDX-License-Identifier: 0BSD
2023-04-01 13:23:33 +00:00
import pytest
2020-10-13 08:35:20 +00:00
from kibicara.model import Hood
from kibicara.platforms.telegram.model import Telegram
2023-04-01 13:23:33 +00:00
@pytest.fixture(scope="function")
@pytest.mark.anyio
async def telegram(hood_id, bot):
2023-03-19 18:03:25 +00:00
hood = await Hood.get(id=hood_id)
return await Telegram.create(
2023-04-01 13:23:33 +00:00
hood=hood,
api_token=bot["api_token"],
welcome_message=bot["welcome_message"],
)