Skip to content

Commit 8a02f78

Browse files
committed
Test missing bot instance
1 parent 0e238e4 commit 8a02f78

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/core_tests/test_bot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55
from sqlalchemy import Column, String, Table
66

7+
import cloudbot.bot
78
from cloudbot import hook
89
from cloudbot.bot import CloudBot, clean_name, get_cmd_regex
910
from cloudbot.event import Event, EventType
@@ -15,6 +16,12 @@
1516
from tests.util.mock_db import MockDB
1617

1718

19+
def test_no_instance_config(unset_bot):
20+
cloudbot.bot.bot.set(None)
21+
with pytest.raises(ValueError):
22+
_ = cloudbot.bot.bot.config
23+
24+
1825
@pytest.mark.asyncio()
1926
async def test_migrate_db(
2027
mock_db, mock_bot_factory, event_loop, mock_requests, tmp_path

0 commit comments

Comments
 (0)