'Test receiving unavailable presences from JIDs that
are not online.'

def testInitialUnavailablePresences(self):

    events = set()
    def got_offline(presence):
        events.add('got_offline')
    def unavailable(presence):
        events.add('unavailable')
    self.xmpp.add_event_handler('got_offline', got_offline)
    self.xmpp.add_event_handler('presence_unavailable', unavailable)
    self.recv('\n                                        <presence    type="unavailable"\n                                                                                from="otheruser@localhost"\n                                                                                to="tester@localhost"/>\n                                ')
    time.sleep(0.1)
    self.assertEqual(events, set(('unavailable',)), ('Got    offline    incorrectly    triggered:    %s.' % events))
