Back to index

moin  1.9.0~rc2
Public Member Functions
test_web.TestMakeQueryString Class Reference

List of all members.

Public Member Functions

def testMakeQueryStringFromArgument
def testMakeQueryStringFromKeywords
def testMakeQueryStringFromArgumentAndKeywords

Detailed Description

util.web: making query string

Definition at line 14 of file test_web.py.


Member Function Documentation

util.web: make query sting from argument 

Definition at line 17 of file test_web.py.

00017 
00018     def testMakeQueryStringFromArgument(self):
00019         """ util.web: make query sting from argument """
00020         tests = (
00021             # description,          arg,                expected
00022             ('string unchanged',    'a=b',              'a=b'),
00023             ('string value',        {'a': 'b'},         'a=b'),
00024             ('integer value',       {'a': 1},           'a=1'),
00025             ('multiply values',     {'a': 1, 'b': 2},   'a=1&b=2'),
00026             )
00027 
00028         for description, arg, expected in tests:
00029             assert wikiutil.makeQueryString(arg) == expected

util.web: make query sting from argument and keywords 

Definition at line 34 of file test_web.py.

00034 
00035     def testMakeQueryStringFromArgumentAndKeywords(self):
00036         """ util.web: make query sting from argument and keywords """
00037 
00038         tests = (
00039             # description,      arg,                    expected
00040             ('kw ignored',      'a=1',                  'a=1'),
00041             ('kw added to arg', {'a': 1},               'a=1&b=kw'),
00042             ('kw override arg', {'a': 1, 'b': 'arg'},   'a=1&b=kw'),
00043             )
00044 
00045         for description, arg, expected in tests:
00046             # Call makeQueryString with both arg and keyword
00047             assert wikiutil.makeQueryString(arg, b='kw') == expected
00048 

util.web: make query sting from keywords 

Definition at line 30 of file test_web.py.

00030 
00031     def testMakeQueryStringFromKeywords(self):
00032         """ util.web: make query sting from keywords """
00033         assert wikiutil.makeQueryString(a=1, b='string') == 'a=1&b=string'


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