Back to index

python3.2  3.2.2
Public Member Functions
test.test_urllib2.TrivialTests Class Reference

List of all members.

Public Member Functions

def test_trivial
def test_parse_http_list

Detailed Description

Definition at line 20 of file test_urllib2.py.


Member Function Documentation

Definition at line 39 of file test_urllib2.py.

00039 
00040     def test_parse_http_list(self):
00041         tests = [
00042             ('a,b,c', ['a', 'b', 'c']),
00043             ('path"o,l"og"i"cal, example', ['path"o,l"og"i"cal', 'example']),
00044             ('a, b, "c", "d", "e,f", g, h',
00045              ['a', 'b', '"c"', '"d"', '"e,f"', 'g', 'h']),
00046             ('a="b\\"c", d="e\\,f", g="h\\\\i"',
00047              ['a="b"c"', 'd="e,f"', 'g="h\\i"'])]
00048         for string, list in tests:
00049             self.assertEqual(urllib.request.parse_http_list(string), list)
00050 

Here is the call graph for this function:

Definition at line 21 of file test_urllib2.py.

00021 
00022     def test_trivial(self):
00023         # A couple trivial tests
00024 
00025         self.assertRaises(ValueError, urllib.request.urlopen, 'bogus url')
00026 
00027         # XXX Name hacking to get this to work on Windows.
00028         fname = os.path.abspath(urllib.request.__file__).replace('\\', '/')
00029 
00030         if os.name == 'nt':
00031             file_url = "file:///%s" % fname
00032         else:
00033             file_url = "file://%s" % fname
00034 
00035         f = urllib.request.urlopen(file_url)
00036 
00037         buf = f.read()
00038         f.close()

Here is the call graph for this function:


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