本文整理匯總了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()