本文整理汇总了Python中celery.worker.hub.Hub.remove方法的典型用法代码示例。如果您正苦于以下问题:Python Hub.remove方法的具体用法?Python Hub.remove怎么用?Python Hub.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类celery.worker.hub.Hub
的用法示例。
在下文中一共展示了Hub.remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_update_writers
# 需要导入模块: from celery.worker.hub import Hub [as 别名]
# 或者: from celery.worker.hub.Hub import remove [as 别名]
def test_update_writers(self):
hub = Hub()
P = hub.poller = Mock()
write_A = Mock()
write_B = Mock()
hub.update_writers({20: write_A, File(21): write_B})
P.register.assert_has_calls([call(20, hub.WRITE), call(File(21), hub.WRITE)], any_order=True)
self.assertIs(hub.writers[20], write_A)
self.assertIs(hub.writers[21], write_B)
hub.remove(20)
self.assertNotIn(20, hub.writers)
hub.remove(File(21))
self.assertNotIn(21, hub.writers)
P.unregister.assert_has_calls([call(20), call(21)])
示例2: test_update_readers
# 需要导入模块: from celery.worker.hub import Hub [as 别名]
# 或者: from celery.worker.hub.Hub import remove [as 别名]
def test_update_readers(self):
hub = Hub()
P = hub.poller = Mock()
read_A = Mock()
read_B = Mock()
hub.update_readers({10: read_A, File(11): read_B})
P.register.assert_has_calls([call(10, hub.READ | hub.ERR), call(File(11), hub.READ | hub.ERR)], any_order=True)
self.assertIs(hub.readers[10], read_A)
self.assertIs(hub.readers[11], read_B)
hub.remove(10)
self.assertNotIn(10, hub.readers)
hub.remove(File(11))
self.assertNotIn(11, hub.readers)
P.unregister.assert_has_calls([call(10), call(11)])
示例3: test_remove__unregister_raises
# 需要导入模块: from celery.worker.hub import Hub [as 别名]
# 或者: from celery.worker.hub.Hub import remove [as 别名]
def test_remove__unregister_raises(self):
hub = Hub()
hub.poller = Mock()
hub.poller.unregister.side_effect = OSError()
hub.remove(313)
示例4: test_can_remove_unknown_fds
# 需要导入模块: from celery.worker.hub import Hub [as 别名]
# 或者: from celery.worker.hub.Hub import remove [as 别名]
def test_can_remove_unknown_fds(self):
hub = Hub()
hub.poller = Mock()
hub.remove(30)
hub.remove(File(301))