Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Commit 0d3442b

Browse files
committed
test: test that imported applications are listed in webxdc update
1 parent 6792aaf commit 0d3442b

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

tests/test_something.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,19 @@ def test_update(acfactory, storebot):
102102

103103
def test_import(acfactory, storebot_example):
104104
"""Test that import works."""
105-
# Do nothing except for initializing `storebot_example` fixture.
106-
# If the test started, it means the bot
107-
# with imported apps has been created successfuly.
108-
pass
105+
(ac1,) = acfactory.get_online_accounts(1)
106+
107+
bot_contact = ac1.create_contact(storebot_example.addr)
108+
bot_chat = bot_contact.create_chat()
109+
bot_chat.send_text("hi!")
110+
111+
msg_in = ac1.wait_next_incoming_message()
112+
ac1._evtracker.get_matching("DC_EVENT_WEBXDC_STATUS_UPDATE")
113+
assert msg_in.text == "Welcome to the appstore bot!"
114+
115+
assert msg_in.is_webxdc()
116+
status_updates = msg_in.get_status_updates()
117+
assert len(status_updates) == 1
118+
payload = status_updates[0]["payload"]
119+
app_infos = payload["app_infos"]
120+
assert len(app_infos) == 4

0 commit comments

Comments
 (0)