コード例 #1
0
 def test_start_already_running_exception(self):
     e = ExecutionEngine(get_crawler(TestSpider), lambda _: None)
     yield e.open_spider(TestSpider(), [])
     e.start()
     yield self.assertFailure(e.start(), RuntimeError).addBoth(
         lambda exc: self.assertEqual(str(exc), "Engine already running"))
     yield e.stop()