fix various location-streaming issue, test passes now

This commit is contained in:
holger krekel
2019-11-02 22:05:33 +01:00
parent d74c70a57c
commit d24a982757
4 changed files with 76 additions and 54 deletions

View File

@@ -827,17 +827,20 @@ class TestOnlineAccount:
lp.sec("ac1: enable location sending in chat")
chat1.enable_sending_locations(seconds=100)
assert chat1.is_sending_locations()
ac1._evlogger.get_matching("DC_EVENT_SMTP_MESSAGE_SENT")
lp.sec("ac1: setting location")
ac1.set_location(latitude=1.0, longitude=2.0)
ac1.set_location(latitude=2.0, longitude=3.0)
ac1._evlogger.get_matching("DC_EVENT_LOCATION_CHANGED")
chat1.send_text("hello")
ac1._evlogger.get_matching("DC_EVENT_SMTP_MESSAGE_SENT")
ac1._evlogger.get_matching("DC_EVENT_SMTP_MESSAGE_SENT")
lp.sec("ac2: wait for incoming location message")
ac2._evlogger.get_matching("DC_EVENT_INCOMING_MSG")
ac2._evlogger.get_matching("DC_EVENT_INCOMING_MSG")
ac2._evlogger.get_matching("DC_EVENT_INCOMING_MSG") # "enabled-location streaming"
# currently core emits location changed before event_incoming message
ac2._evlogger.get_matching("DC_EVENT_LOCATION_CHANGED")
ac2._evlogger.get_matching("DC_EVENT_INCOMING_MSG") # text message with location
# contact = ac2.create_contact(ac1.get_config("addr"))
locations = chat2.get_locations() # XXX per contact
assert len(locations) >= 1