File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -63,3 +63,29 @@ def test_authorization_header(content: bytes | str) -> None:
6363 )
6464
6565 assert result == "VWS my_access_key:8Uy6SKuO5sSBY2X8/znlPFmDF/k="
66+
67+
68+ @pytest .mark .parametrize ("content" , [b"" , None ])
69+ def test_authorization_header_none_content (content : bytes | None ) -> None :
70+ """
71+ The Authorization header is the same whether the content is None or b"".
72+ """
73+ access_key = "my_access_key"
74+ # Ignore "Possible hardcoded password" as it is appropriate here.
75+ secret_key = "my_secret_key" # noqa: S105
76+ method = "HTTPMETHOD"
77+ content_type = "some/content/type"
78+ date = "some_date_string"
79+ request_path = "/foo"
80+
81+ result = vws_auth_tools .authorization_header (
82+ access_key = access_key ,
83+ secret_key = secret_key ,
84+ method = method ,
85+ content = content ,
86+ content_type = content_type ,
87+ date = date ,
88+ request_path = request_path ,
89+ )
90+
91+ assert result == "VWS my_access_key:XXvKyRyMkwS8/1P1WLQ0duqNpKs="
You can’t perform that action at this time.
0 commit comments