Skip to content

Commit

Permalink
add unittest for wechaty
Browse files Browse the repository at this point in the history
  • Loading branch information
wj-Mcat committed Nov 20, 2022
1 parent 71a0cf3 commit ad7dd5b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/wechaty_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
import pytest
import os
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from wechaty_puppet import WechatyPuppetConfigurationError
from wechaty import Wechaty, WechatyOptions

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

assert bot.puppet.options.token == 'fake-token'
assert bot.puppet.options.end_point == '127.0.0.1:8080'


def test_scheduler():
"""test add scheduler in the options"""
scheduler = AsyncIOScheduler()
options = WechatyOptions(
scheduler=scheduler
)
bot = Wechaty(options=options)
assert id(scheduler) == id(bot._plugin_manager.scheduler)

0 comments on commit ad7dd5b

Please sign in to comment.