'Test the metainfo lookup of the DHT session'

@deferred(timeout=10)
def test_connect_to_tracker(self):

    def get_metainfo(infohash, callback, **_):
        callback({'seeders': 1, 'leechers': 2})
    def verify_metainfo(metainfo):
        self.assertTrue(('DHT' in metainfo))
        self.assertEqual(metainfo['DHT'][0]['leechers'], 2)
        self.assertEqual(metainfo['DHT'][0]['seeders'], 1)
    self.session.lm.ltmgr = MockObject()
    self.session.lm.ltmgr.get_metainfo = get_metainfo
    return self.dht_session.connect_to_tracker().addCallback(verify_metainfo)
