Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.test_urllib Namespace Reference

Classes

class  urlopen_FileTests
class  ProxyTests
class  urlopen_HttpTests
class  urlretrieve_FileTests
class  QuotingTests
class  UnquotingTests
class  urlencode_Tests
class  Pathname_Tests
class  Utility_Tests
class  URLopener_Tests

Functions

def hexescape
def urlopen
def test_main

Variables

 _urlopener = None

Detailed Description

Regresssion tests for urllib

Function Documentation

Escape char as RFC 2396 specifies

Definition at line 15 of file test_urllib.py.

00015 
00016 def hexescape(char):
00017     """Escape char as RFC 2396 specifies"""
00018     hex_repr = hex(ord(char))[2:].upper()
00019     if len(hex_repr) == 1:
00020         hex_repr = "0%s" % hex_repr
00021     return "%" + hex_repr
00022 
# Shortcut for testing FancyURLopener

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1157 of file test_urllib.py.

01157 
01158 def test_main():
01159     support.run_unittest(
01160         urlopen_FileTests,
01161         urlopen_HttpTests,
01162         urlretrieve_FileTests,
01163         ProxyTests,
01164         QuotingTests,
01165         UnquotingTests,
01166         urlencode_Tests,
01167         Pathname_Tests,
01168         Utility_Tests,
01169         URLopener_Tests,
01170         #FTPWrapperTests,
01171     )
01172 
01173 

def test.test_urllib.urlopen (   url,
  data = None,
  proxies = None 
)
urlopen(url [, data]) -> open file-like object

Definition at line 24 of file test_urllib.py.

00024 
00025 def urlopen(url, data=None, proxies=None):
00026     """urlopen(url [, data]) -> open file-like object"""
00027     global _urlopener
00028     if proxies is not None:
00029         opener = urllib.request.FancyURLopener(proxies=proxies)
00030     elif not _urlopener:
00031         opener = urllib.request.FancyURLopener()
00032         _urlopener = opener
00033     else:
00034         opener = _urlopener
00035     if data is None:
00036         return opener.open(url)
00037     else:
00038         return opener.open(url, data)

Here is the caller graph for this function:


Variable Documentation

Definition at line 23 of file test_urllib.py.