Skip to content

Commit ad7dd5b

Browse files
committed
add unittest for wechaty
1 parent 71a0cf3 commit ad7dd5b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/wechaty_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44
import pytest
55
import os
6+
from apscheduler.schedulers.asyncio import AsyncIOScheduler
67
from wechaty_puppet import WechatyPuppetConfigurationError
78
from wechaty import Wechaty, WechatyOptions
89

@@ -19,3 +20,13 @@ def test_constructor():
1920

2021
assert bot.puppet.options.token == 'fake-token'
2122
assert bot.puppet.options.end_point == '127.0.0.1:8080'
23+
24+
25+
def test_scheduler():
26+
"""test add scheduler in the options"""
27+
scheduler = AsyncIOScheduler()
28+
options = WechatyOptions(
29+
scheduler=scheduler
30+
)
31+
bot = Wechaty(options=options)
32+
assert id(scheduler) == id(bot._plugin_manager.scheduler)

0 commit comments

Comments
 (0)