Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_quopri.QuopriTestCase Class Reference

List of all members.

Public Member Functions

def test_encodestring
def test_decodestring
def test_idempotent_string
def test_encode
def test_decode
def test_embedded_ws
def test_encode_header
def test_decode_header
def test_scriptencode
def test_scriptdecode

Static Public Attributes

tuple STRINGS
tuple ESTRINGS
tuple HSTRINGS

Detailed Description

Definition at line 65 of file test_quopri.py.


Member Function Documentation

Definition at line 154 of file test_quopri.py.

00154 
00155     def test_decode(self):
00156         for p, e in self.STRINGS:
00157             infp = io.BytesIO(e)
00158             outfp = io.BytesIO()
00159             quopri.decode(infp, outfp)
00160             self.assertEqual(outfp.getvalue(), p)

Here is the call graph for this function:

Definition at line 173 of file test_quopri.py.

00173 
00174     def test_decode_header(self):
00175         for p, e in self.HSTRINGS:
00176             self.assertEqual(quopri.decodestring(e, header=True), p)

Here is the call graph for this function:

Definition at line 136 of file test_quopri.py.

00136 
00137     def test_decodestring(self):
00138         for p, e in self.STRINGS:
00139             self.assertEqual(quopri.decodestring(e), p)

Here is the call graph for this function:

Definition at line 162 of file test_quopri.py.

00162 
00163     def test_embedded_ws(self):
00164         for p, e in self.ESTRINGS:
00165             self.assertEqual(quopri.encodestring(p, quotetabs=True), e)
00166             self.assertEqual(quopri.decodestring(e), p)

Here is the call graph for this function:

Definition at line 146 of file test_quopri.py.

00146 
00147     def test_encode(self):
00148         for p, e in self.STRINGS:
00149             infp = io.BytesIO(p)
00150             outfp = io.BytesIO()
00151             quopri.encode(infp, outfp, quotetabs=False)
00152             self.assertEqual(outfp.getvalue(), e)

Here is the call graph for this function:

Definition at line 168 of file test_quopri.py.

00168 
00169     def test_encode_header(self):
00170         for p, e in self.HSTRINGS:
00171             self.assertEqual(quopri.encodestring(p, header=True), e)

Here is the call graph for this function:

Definition at line 131 of file test_quopri.py.

00131 
00132     def test_encodestring(self):
00133         for p, e in self.STRINGS:
00134             self.assertEqual(quopri.encodestring(p), e)

Here is the call graph for this function:

Definition at line 141 of file test_quopri.py.

00141 
00142     def test_idempotent_string(self):
00143         for p, e in self.STRINGS:
00144             self.assertEqual(quopri.decodestring(quopri.encodestring(e)), e)

Here is the call graph for this function:

Definition at line 193 of file test_quopri.py.

00193 
00194     def test_scriptdecode(self):
00195         (p, e) = self.STRINGS[-1]
00196         process = subprocess.Popen([sys.executable, "-mquopri", "-d"],
00197                                    stdin=subprocess.PIPE, stdout=subprocess.PIPE)
00198         self.addCleanup(process.stdout.close)
00199         cout, cerr = process.communicate(e)
00200         cout = cout.decode('latin-1')
00201         p = p.decode('latin-1')
00202         self.assertEqual(cout.splitlines(), p.splitlines())

Here is the call graph for this function:

Definition at line 177 of file test_quopri.py.

00177 
00178     def test_scriptencode(self):
00179         (p, e) = self.STRINGS[-1]
00180         process = subprocess.Popen([sys.executable, "-mquopri"],
00181                                    stdin=subprocess.PIPE, stdout=subprocess.PIPE)
00182         self.addCleanup(process.stdout.close)
00183         cout, cerr = process.communicate(p)
00184         # On Windows, Python will output the result to stdout using
00185         # CRLF, as the mode of stdout is text mode. To compare this
00186         # with the expected result, we need to do a line-by-line comparison.
00187         cout = cout.decode('latin-1').splitlines()
00188         e = e.decode('latin-1').splitlines()
00189         assert len(cout)==len(e)
00190         for i in range(len(cout)):
00191             self.assertEqual(cout[i], e[i])
00192         self.assertEqual(cout, e)

Here is the call graph for this function:


Member Data Documentation

Initial value:
(
        (b'hello world', b'hello=20world'),
        (b'hello\tworld', b'hello=09world'),
        )

Definition at line 119 of file test_quopri.py.

Initial value:
(
        (b'hello world', b'hello_world'),
        (b'hello_world', b'hello=5Fworld'),
        )

Definition at line 125 of file test_quopri.py.

Definition at line 68 of file test_quopri.py.


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