本文整理匯總了Python中radula.RadulaProxy.verify方法的典型用法代碼示例。如果您正苦於以下問題:Python RadulaProxy.verify方法的具體用法?Python RadulaProxy.verify怎麽用?Python RadulaProxy.verify使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類radula.RadulaProxy
的用法示例。
在下文中一共展示了RadulaProxy.verify方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: verify_test
# 需要導入模塊: from radula import RadulaProxy [as 別名]
# 或者: from radula.RadulaProxy import verify [as 別名]
def verify_test():
# ensure original text
with open(TEST_FILE, 'w') as test_file:
test_file.write("data")
radu = RadulaProxy(connection=boto.connect_s3())
radu.make_bucket(subject=TEST_BUCKET)
# give something to download
args = vars(_parse_args(['up']))
args.update({
"subject": TEST_FILE,
"target": REMOTE_FILE
})
radu.upload(**args)
sys.stdout.truncate(0)
handler = TestHandler(Matcher())
logger = logging.getLogger()
logger.addHandler(handler)
# 'threads' needed
args = vars(_parse_args(["verify"]))
args.update({
"subject": TEST_FILE,
"target": REMOTE_FILE
})
radu.verify(**args)
assert_false(handler.matches(levelno=logging.ERROR))
assert_false(handler.matches(levelno=logging.WARNING))
assert_true(handler.matches(levelno=logging.INFO))
msgs = [
"Checksum Verified!",
'8d777f385d3dfec8815d20f7496026dc',
]
for msg in msgs:
fmt = "Expecting log message containing '{0}'"
assert_true(handler.matches(message=msg), msg=fmt.format(msg))
示例2: verify_fail_method
# 需要導入模塊: from radula import RadulaProxy [as 別名]
# 或者: from radula.RadulaProxy import verify [as 別名]
def verify_fail_method(test_set):
radu = RadulaProxy(connection=boto.connect_s3())
args = vars(_parse_args(["verify"]))
args.update(test_set)
radu.verify(**args)