Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
Fix tests: remove assertions from asyncronously called code
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianriese committed Apr 7, 2017
1 parent 1b2fb3b commit 9139ea0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/avatar/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,10 @@ def test_on_metadata_changed(self):
avatar_server = self.client.summon(aioxmpp.avatar.AvatarServer)
avatar_client = self.client.summon(aioxmpp.avatar.AvatarClient)

done = asyncio.Event()
done_future = asyncio.Future()

def handler(jid, metadata):
self.assertEqual(jid, self.client.local_jid.bare())
self.assertEqual(len(metadata), 1)
done.set()
done_future.set_result((jid, metadata))

avatar_client.on_metadata_changed.connect(handler)

Expand All @@ -184,4 +182,6 @@ def handler(jid, metadata):
logging.info("publishing avatar")
yield from avatar_server.publish_avatar_set(avatar_set)
logging.info("waiting for completion")
yield from done.wait()
jid, metadata = yield from done_future
self.assertEqual(jid, self.client.local_jid.bare())
self.assertEqual(len(metadata), 1)

0 comments on commit 9139ea0

Please sign in to comment.