本文整理汇总了Python中mkt.webapps.tasks.pre_generate_apk.delay函数的典型用法代码示例。如果您正苦于以下问题:Python delay函数的具体用法?Python delay怎么用?Python delay使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了delay函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get
def test_get(self, req):
res = mock.Mock()
req.get.return_value = res
pre_generate_apk.delay(self.app.id)
assert req.get.called, "APK requested from factory"
assert req.get.mock_calls[0].startswith(settings.PRE_GENERATE_APK_URL), req.get.mock_calls
assert res.raise_for_status.called, "raise on bad status codes"
示例2: test_error_getting
def test_error_getting(self, req):
req.get.side_effect = RequestException
with self.assertRaises(PreGenAPKError):
pre_generate_apk.delay(self.app.id)
示例3: test_no_manifest
def test_no_manifest(self, req):
self.app.update(manifest_url=None)
with self.assertRaises(PreGenAPKError):
pre_generate_apk.delay(self.app.id)
示例4: test_get_packaged
def test_get_packaged(self, req):
self.app.update(manifest_url=None, is_packaged=True)
# Make sure this doesn't raise an exception.
pre_generate_apk.delay(self.app.id)
assert req.get.called, 'APK requested from factory'