def test_load_seedfile_failure(self): """ test load_seedfile function failure """ seedfile = 'urls1' resno, resinfo = seedfile_load.load_seedfile(seedfile) self.assertNotEqual(resno, 0)
#check load config file ok? if config_para_code != 0: #error print 'load config file error', config_para_item logging.error('load config file ' + str(config_para_code) + ', ' + config_para_item) sys.exit(LOAD_CONFIGFILE_ERROR) #load config ok logging.info('load config ok') conf_url_list_file = config_para_item['url_list_file'] conf_thread_count = config_para_item['thread_count'] #load seed file logging.debug('load seed file...') seedfile_load_code, seedfile_load_item = seedfile_load.load_seedfile(conf_url_list_file) #check load seed file ok? if seedfile_load_code != 0: #error logging.error('load seed file ' + str(seedfile_load_code) + ', ' + seedfile_load_item) sys.exit(LOAD_SEEDFILE_ERROR) #load seedfile ok logging.info('load seed file ok') #creat seed uri list #Queue<Tuple(uri, depth)> uri_queue = Queue.Queue() #initial seed uri to uri_queue
def test_load_seedfile_success(self): """ test load_seedfile function success """ seedfile = 'urls' resno, resinfo = seedfile_load.load_seedfile(seedfile) self.assertEqual(resno, 0)
def testLoadSeedfile(self): """ test seedfile module """ seedfile = 'urls' resno, resinfo = seedfile_load.load_seedfile(seedfile) self.assertEqual(resno, 0)