本文整理汇总了Python中mkt.extensions.models.Extension.sign_and_move_file方法的典型用法代码示例。如果您正苦于以下问题:Python Extension.sign_and_move_file方法的具体用法?Python Extension.sign_and_move_file怎么用?Python Extension.sign_and_move_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mkt.extensions.models.Extension
的用法示例。
在下文中一共展示了Extension.sign_and_move_file方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_sign_and_move_file_error
# 需要导入模块: from mkt.extensions.models import Extension [as 别名]
# 或者: from mkt.extensions.models.Extension import sign_and_move_file [as 别名]
def test_sign_and_move_file_error(self, remove_signed_file_mock,
private_storage_mock, sign_app_mock):
extension = Extension(uuid='12345678123456781234567812345678')
sign_app_mock.side_effect = SigningError
with self.assertRaises(SigningError):
extension.sign_and_move_file()
eq_(remove_signed_file_mock.call_count, 1)
示例2: test_sign_and_move_file
# 需要导入模块: from mkt.extensions.models import Extension [as 别名]
# 或者: from mkt.extensions.models.Extension import sign_and_move_file [as 别名]
def test_sign_and_move_file(self, remove_signed_file_mock,
private_storage_mock, sign_app_mock):
extension = Extension(uuid='12345678123456781234567812345678')
extension.sign_and_move_file()
expected_args = (
private_storage_mock.open.return_value,
extension.signed_file_path,
json.dumps({
'id': extension.uuid,
'version': 1
})
)
eq_(sign_app_mock.call_args[0], expected_args)
eq_(remove_signed_file_mock.call_count, 0)
示例3: test_sign_and_move_file_no_uuid
# 需要导入模块: from mkt.extensions.models import Extension [as 别名]
# 或者: from mkt.extensions.models.Extension import sign_and_move_file [as 别名]
def test_sign_and_move_file_no_uuid(self, private_storage_mock,
sign_app_mock):
extension = Extension(uuid='')
with self.assertRaises(SigningError):
extension.sign_and_move_file()