def test_init(self): " Test that init loads the configuration. " a = SimpleCommand() c = Crawler([a, a, a], {'number_threads': 0}, {}) self.assertEquals(c.route, [a,a,a]) self.assertEquals(c.config['number_threads'], 0) c._shutdown()
def test_run(self): import sys sys.argv = ['tcrawler', 'testrun_cfg'] c = Crawler(*load_config_module()) c.start() self.assertTrue(c.work_queue.empty())
def test_start(self): " Test the loader start method. " c = Crawler([SimpleCommand()], {'number_threads': 2}, {}) c.start() self.assertTrue(c.work_queue.empty())
def test_blank_config_init(self): " Test that init method with blank config. " c = Crawler([], {}, {}) self.assertEquals(c.route, []) c._shutdown()