示例#1
0
def _verify_headers(headers, contents):
    assert "Content-length" in headers
    assert str(len(contents)) == headers['Content-length']
    assert "Content-type" in headers
    assert "Content-md5" in headers
    content_md5 = aws_md5(contents.encode("ascii"))
    assert content_md5 == headers['Content-md5']
    assert "Authorization" in headers
示例#2
0
 def test_aws_md5_fp(self):
     val = "Hello world!".encode("ascii")
     eq_(aws_md5(BytesIO(val)), 'hvsmnRkNLIX24EaM7KQqIA==')
示例#3
0
 def test_aws_md5_fp(self):
     val = "Hello world!".encode("ascii")
     eq_(aws_md5(BytesIO(val)), 'hvsmnRkNLIX24EaM7KQqIA==')
示例#4
0
 def test_aws_md5_lit(self):
     val = "Hello!".encode("ascii")
     eq_(aws_md5(val), 'lS0sVtBIWVgzZ0e83ZhZDQ==')
示例#5
0
 def test_aws_md5_lit(self):
     val = "Hello!".encode("ascii")
     eq_(aws_md5(val), 'lS0sVtBIWVgzZ0e83ZhZDQ==')