MCPcopy
hub / github.com/wechaty/python-wechaty / test_finder

Method test_finder

tests/plugin_test.py:78–95  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

76
77
78 async def test_finder(self):
79 fake_puppet = FakePuppet()
80 bot = Wechaty(options=WechatyOptions(puppet=fake_puppet))
81
82 contact_id = fake_puppet.add_random_fake_contact()
83
84 contact_payload = await fake_puppet.contact_payload(contact_id)
85 from wechaty_plugin_contrib.finders.contact_finder import ContactFinder
86 finder = ContactFinder(
87 contact_id
88 )
89 contacts = await finder.match(bot)
90 assert len(contacts) == 1
91
92 contact = contacts[0]
93 await contact.ready()
94
95 assert contact.payload.name == contact_payload.name
96

Callers

nothing calls this directly

Calls 6

contact_payloadMethod · 0.95
FakePuppetClass · 0.90
WechatyClass · 0.90
WechatyOptionsClass · 0.90
readyMethod · 0.45

Tested by

no test coverage detected