'Test that got_online is triggered properly.'

def testGotOnline(self):

    events = set()
    def presence_available(p):
        events.add('presence_available')
    def got_online(p):
        events.add('got_online')
    self.xmpp.add_event_handler('presence_available', presence_available)
    self.xmpp.add_event_handler('got_online', got_online)
    self.recv('\n                                        <presence    from="user@localhost"\n                                                                                to="tester@localhost"    />\n                                ')
    time.sleep(0.1)
    expected = set(('presence_available', 'got_online'))
    self.assertEqual(events, expected, ('Incorrect    events    triggered:    %s' % events))
