本文整理汇总了Python中openerp.addons.connector.queue.job.OpenERPJobStorage._worker_id方法的典型用法代码示例。如果您正苦于以下问题:Python OpenERPJobStorage._worker_id方法的具体用法?Python OpenERPJobStorage._worker_id怎么用?Python OpenERPJobStorage._worker_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openerp.addons.connector.queue.job.OpenERPJobStorage
的用法示例。
在下文中一共展示了OpenERPJobStorage._worker_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_job_worker
# 需要导入模块: from openerp.addons.connector.queue.job import OpenERPJobStorage [as 别名]
# 或者: from openerp.addons.connector.queue.job.OpenERPJobStorage import _worker_id [as 别名]
def test_job_worker(self):
worker = self.env["queue.worker"].create({"uuid": "57569b99-c2c1-47b6-aad1-72f953c92c87"})
test_job = Job(func=dummy_task_args, model_name="res.users", args=("o", "k"), kwargs={"c": "!"})
test_job.worker_uuid = worker.uuid
storage = OpenERPJobStorage(self.session)
self.assertEqual(storage._worker_id(worker.uuid), worker.id)
storage.store(test_job)
job_read = storage.load(test_job.uuid)
self.assertEqual(job_read.worker_uuid, worker.uuid)
示例2: test_job_worker
# 需要导入模块: from openerp.addons.connector.queue.job import OpenERPJobStorage [as 别名]
# 或者: from openerp.addons.connector.queue.job.OpenERPJobStorage import _worker_id [as 别名]
def test_job_worker(self):
worker = self.env['queue.worker'].create(
{'uuid': '57569b99-c2c1-47b6-aad1-72f953c92c87'}
)
test_job = Job(func=dummy_task_args,
model_name='res.users',
args=('o', 'k'),
kwargs={'c': '!'})
test_job.worker_uuid = worker.uuid
storage = OpenERPJobStorage(self.session)
self.assertEqual(storage._worker_id(worker.uuid), worker.id)
storage.store(test_job)
job_read = storage.load(test_job.uuid)
self.assertEqual(job_read.worker_uuid, worker.uuid)