def _load_torrents(self, folder):
     self.folder = folder
     
     assert os.path.isdir(self.folder), "torrent dir %s must exist!" % self.folder  
     
     self.torrents = get_torrents(self.folder)
     self._logger.info("loaded torrents: %s" % self.torrents)
예제 #2
0
 def setUp(self):
     # map torrent id to (tdef, filename)
     torrents = get_torrents(TORRENT_FOLDER)
     self.downloads = []
      
     self.started_at = {}
     for (id, value) in torrents.items():
         (tdef, file) = value
         self.downloads.append(tdef)
         self.started_at[id] = 100-len(self.downloads)
         print "%s -> %s " % (id, tdef)
         
     print "\nStarted at: ", self.started_at
     self.assertEquals(7, len(self.downloads))
     self.assertEquals(7, len(self.started_at))