'Testing the metainfo fetching method'

@deferred(timeout=20)
def test_get_metainfo(self):

    test_deferred = Deferred()
    def metainfo_cb(metainfo):
        self.assertEqual(metainfo, 'test')
        test_deferred.callback(None)
    self.ltmgr.initialize()
    self.ltmgr.is_dht_ready = (lambda : True)
    self.ltmgr.metainfo_cache[('a' * 20).encode('hex')] = {'meta_info': 'test'}
    self.ltmgr.get_metainfo(('a' * 20), metainfo_cb)
    return test_deferred
