MCPcopy
hub / github.com/nonebot/nonebot2 / test_get_bot

Function test_get_bot

tests/test_init.py:91–101  ·  view source on GitHub ↗
(app: App, monkeypatch: pytest.MonkeyPatch)

Source from the content-addressed store, hash-verified

89
90
91def test_get_bot(app: App, monkeypatch: pytest.MonkeyPatch):
92 driver = get_driver()
93
94 with pytest.raises(ValueError, match="no bots"):
95 get_bot()
96
97 with monkeypatch.context() as m:
98 m.setattr(driver, "_bots", {"test": "test"})
99 assert get_bot() == "test"
100 assert get_bot("test") == "test"
101 assert get_bots() == {"test": "test"}

Callers

nothing calls this directly

Calls 3

get_driverFunction · 0.90
get_botFunction · 0.90
get_botsFunction · 0.90

Tested by

no test coverage detected