Back to index

python3.2  3.2.2
Public Member Functions
test.test_uu.UUTest Class Reference

List of all members.

Public Member Functions

def test_encode
def test_decode
def test_truncatedinput
def test_missingbegin

Detailed Description

Definition at line 52 of file test_uu.py.


Member Function Documentation

Definition at line 64 of file test_uu.py.

00064 
00065     def test_decode(self):
00066         inp = io.BytesIO(encodedtextwrapped(0o666, "t1"))
00067         out = io.BytesIO()
00068         uu.decode(inp, out)
00069         self.assertEqual(out.getvalue(), plaintext)
00070         inp = io.BytesIO(
00071             b"UUencoded files may contain many lines,\n" +
00072             b"even some that have 'begin' in them.\n" +
00073             encodedtextwrapped(0o666, "t1")
00074         )
00075         out = io.BytesIO()
00076         uu.decode(inp, out)
00077         self.assertEqual(out.getvalue(), plaintext)

Here is the call graph for this function:

Definition at line 54 of file test_uu.py.

00054 
00055     def test_encode(self):
00056         inp = io.BytesIO(plaintext)
00057         out = io.BytesIO()
00058         uu.encode(inp, out, "t1")
00059         self.assertEqual(out.getvalue(), encodedtextwrapped(0o666, "t1"))
00060         inp = io.BytesIO(plaintext)
00061         out = io.BytesIO()
00062         uu.encode(inp, out, "t1", 0o644)
00063         self.assertEqual(out.getvalue(), encodedtextwrapped(0o644, "t1"))

Here is the call graph for this function:

Definition at line 87 of file test_uu.py.

00087 
00088     def test_missingbegin(self):
00089         inp = io.BytesIO(b"")
00090         out = io.BytesIO()
00091         try:
00092             uu.decode(inp, out)
00093             self.fail("No exception thrown")
00094         except uu.Error as e:
00095             self.assertEqual(str(e), "No valid begin line found in input file")

Here is the call graph for this function:

Definition at line 78 of file test_uu.py.

00078 
00079     def test_truncatedinput(self):
00080         inp = io.BytesIO(b"begin 644 t1\n" + encodedtext)
00081         out = io.BytesIO()
00082         try:
00083             uu.decode(inp, out)
00084             self.fail("No exception thrown")
00085         except uu.Error as e:
00086             self.assertEqual(str(e), "Truncated input file")

Here is the call graph for this function:


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