Back to index

python3.2  3.2.2
Public Member Functions
test.test_base64.LegacyBase64TestCase Class Reference

List of all members.

Public Member Functions

def test_encodebytes
def test_decodebytes
def test_encode
def test_decode

Detailed Description

Definition at line 10 of file test_base64.py.


Member Function Documentation

Definition at line 54 of file test_base64.py.

00054 
00055     def test_decode(self):
00056         from io import BytesIO
00057         infp = BytesIO(b'd3d3LnB5dGhvbi5vcmc=')
00058         outfp = BytesIO()
00059         base64.decode(infp, outfp)
00060         self.assertEqual(outfp.getvalue(), b'www.python.org')
00061 

Here is the call graph for this function:

Definition at line 26 of file test_base64.py.

00026 
00027     def test_decodebytes(self):
00028         eq = self.assertEqual
00029         eq(base64.decodebytes(b"d3d3LnB5dGhvbi5vcmc=\n"), b"www.python.org")
00030         eq(base64.decodebytes(b"YQ==\n"), b"a")
00031         eq(base64.decodebytes(b"YWI=\n"), b"ab")
00032         eq(base64.decodebytes(b"YWJj\n"), b"abc")
00033         eq(base64.decodebytes(b"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE"
00034                                b"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT"
00035                                b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n"),
00036            b"abcdefghijklmnopqrstuvwxyz"
00037            b"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
00038            b"0123456789!@#0^&*();:<>,. []{}")
00039         eq(base64.decodebytes(b''), b'')
00040         self.assertRaises(TypeError, base64.decodebytes, "")

Here is the call graph for this function:

Definition at line 41 of file test_base64.py.

00041 
00042     def test_encode(self):
00043         eq = self.assertEqual
00044         from io import BytesIO
00045         infp = BytesIO(b'abcdefghijklmnopqrstuvwxyz'
00046                        b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
00047                        b'0123456789!@#0^&*();:<>,. []{}')
00048         outfp = BytesIO()
00049         base64.encode(infp, outfp)
00050         eq(outfp.getvalue(),
00051            b'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE'
00052            b'RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT'
00053            b'Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n')

Here is the call graph for this function:

Definition at line 11 of file test_base64.py.

00011 
00012     def test_encodebytes(self):
00013         eq = self.assertEqual
00014         eq(base64.encodebytes(b"www.python.org"), b"d3d3LnB5dGhvbi5vcmc=\n")
00015         eq(base64.encodebytes(b"a"), b"YQ==\n")
00016         eq(base64.encodebytes(b"ab"), b"YWI=\n")
00017         eq(base64.encodebytes(b"abc"), b"YWJj\n")
00018         eq(base64.encodebytes(b""), b"")
00019         eq(base64.encodebytes(b"abcdefghijklmnopqrstuvwxyz"
00020                                b"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
00021                                b"0123456789!@#0^&*();:<>,. []{}"),
00022            b"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE"
00023            b"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT"
00024            b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n")
00025         self.assertRaises(TypeError, base64.encodebytes, "")

Here is the call graph for this function:


The documentation for this class was generated from the following file: