コード例 #1
0
    def test_binary_with_truncated_padding(self):
        padded_value = base64.b64encode(b"1234")
        assert padded_value.endswith(b"=")

        trimmed_value = padded_value[:-2]
        assert decode_header((b"foo-bin", trimmed_value)) == (
            "foo-bin",
            b"1234",
        )
コード例 #2
0
 def test_string_value(self):
     assert decode_header((b"foo", b"123")) == ("foo", "123")
コード例 #3
0
 def test_binary(self):
     assert decode_header((b"foo-bin", base64.b64encode(b"123"))) == (
         "foo-bin",
         b"123",
     )