本文整理匯總了Python中frontera.settings.Settings.SPIDER_PARTITION_ID方法的典型用法代碼示例。如果您正苦於以下問題:Python Settings.SPIDER_PARTITION_ID方法的具體用法?Python Settings.SPIDER_PARTITION_ID怎麽用?Python Settings.SPIDER_PARTITION_ID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類frontera.settings.Settings
的用法示例。
在下文中一共展示了Settings.SPIDER_PARTITION_ID方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_feed_partitions_less_than_equal_partion_id_and_partion_id_less_than_zero
# 需要導入模塊: from frontera.settings import Settings [as 別名]
# 或者: from frontera.settings.Settings import SPIDER_PARTITION_ID [as 別名]
def test_feed_partitions_less_than_equal_partion_id_and_partion_id_less_than_zero(self):
settings = Settings()
# test partition_id > feed_partitions
settings.SPIDER_PARTITION_ID = 2
settings.SPIDER_FEED_PARTITIONS = 1
self.assertRaises(ValueError, self.mbb_setup, settings)
# test partition_id = feed_partitions
settings.SPIDER_PARTITION_ID = 1
self.assertRaises(ValueError, self.mbb_setup, settings)
# test partition_id < 0
settings.SPIDER_PARTITION_ID = -1
self.assertRaises(ValueError, self.mbb_setup, settings)