def testNoSisSelectorCreation(self): return #default should be local folder selector = LocalFolderSelector() ts = TorrentSelection.start_torrent_selection(DummyCache(), selector, 10) try: mech = ts.selector self.assertEquals((LocalFolderSelector), type(mech)) except: sys.exit(-1) finally: ts.stop()
def testNoSisLocalFolderSelection(self): ''' Start and finish thread! ''' cache = DummyCache() assert len(cache.running) == 0 #default should be local folder ts = TorrentSelection.start_torrent_selection(cache, LocalFolderSelector(), 2) try: mech = ts.selector isinstance(mech, LocalFolderSelector) # now let it run for some iterations #cache.running.clear() # test threading #selector.start() time.sleep(5) # should be enough to find all torrents finally: ts.stop() # expect selector to find all 7 available torrents assert len(cache.running) > 0, len(cache.running)
def testSisIoPSelection(self): ''' Start and finish thread! ''' #TODO: only if IoP is active! cache = DummyCache() assert len(cache.running) == 0 selector = IoP_WSClientImpl.IoP_WSClientImpl() ts = TorrentSelection.start_torrent_selection(cache, selector, 2) try: mech = ts.selector self.assertEquals((IoP_WSClientImpl.IoP_WSClientImpl), mech.__class__) # now let it run for some iterations #cache.running.clear() # test threading #selector.start() time.sleep(5) # should be enough to find all torrents finally: ts.stop() # expect selector to find all 7 available torrents assert len(cache.running) >= 0, len(cache.running)