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
def test_aws_md5_fp(self): val = "Hello world!".encode("ascii") eq_(aws_md5(BytesIO(val)), 'hvsmnRkNLIX24EaM7KQqIA==')
def test_aws_md5_lit(self): val = "Hello!".encode("ascii") eq_(aws_md5(val), 'lS0sVtBIWVgzZ0e83ZhZDQ==')