'test archive mode. Use diretory because easier to fetch torrent'

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

    self.boosting_manager.add_source(TESTS_DATA_DIR)
    self.boosting_manager.set_archive(TESTS_DATA_DIR, True)
    dir_obj = self.boosting_manager.get_source_object(TESTS_DATA_DIR)
    self.assertTrue(dir_obj.ready, 'Not    Ready')
    def check_archive(_):
        '\n                                                function    to    check    whether    two    of    the    torrents    is    in    archive    mode    (with    preload)\n                                                '
        for infohash in list(self.boosting_manager.torrents):
            torrent = self.boosting_manager.torrents[infohash]
            self.assertIsNotNone(torrent.get('preload'))
    d = self.check_torrents(TESTS_DATA_DIR, target=2)
    d.addCallback(check_archive)
    return d
