예제 #1
0
    def test_b64_encode_with_unicode_encoded_as_unicode(self):
        """Some servers will respond with unicode encoded strings. The
        test below uses unicode open and close quotes around the max
        age setting, which raises an exception if we treat it as a
        string.

        This test ensures we recognize the unicode encoded string act
        accordingly.
        """
        unicode_result = _b64_encode(self.unicode_string.encode('utf-8'))
        assert _b64_decode_str(unicode_result) == self.unicode_string

        bytes_result = _b64_encode(self.unicode_string)
        assert _b64_decode_str(bytes_result) == self.unicode_string
예제 #2
0
    def test_b64_encode_with_unicode_encoded_as_unicode(self):
        """Some servers will respond with unicode encoded strings. The
        test below uses unicode open and close quotes around the max
        age setting, which raises an exception if we treat it as a
        string.

        This test ensures we recognize the unicode encoded string act
        accordingly.
        """
        unicode_result = _b64_encode(self.unicode_string.encode('utf-8'))
        assert _b64_decode_str(unicode_result) == self.unicode_string

        bytes_result = _b64_encode(self.unicode_string)
        assert _b64_decode_str(bytes_result) == self.unicode_string
예제 #3
0
 def test_b64_encode_with_str(self, encode_str):
     _b64_encode(self.unicode_string)
     assert encode_str.called
예제 #4
0
 def test_b64_encode_with_bytes(self, encode_bytes):
     _b64_encode(self.unicode_string.encode('utf-8'))
     assert encode_bytes.called
예제 #5
0
 def test_b64_encode_with_str(self, encode_str):
     _b64_encode(self.unicode_string)
     assert encode_str.called
예제 #6
0
 def test_b64_encode_with_bytes(self, encode_bytes):
     _b64_encode(self.unicode_string.encode('utf-8'))
     assert encode_bytes.called