コード例 #1
0
 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()
コード例 #2
0
 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()
コード例 #3
0
 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)
コード例 #4
0
 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)
コード例 #5
0
    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)
コード例 #6
0
    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)