@ -31,27 +31,27 @@ class TestINILookup(unittest.TestCase):
# Simple case
# Simple case
dict (
dict (
term = u ' keyA section=sectionA file=/path/to/file ' ,
term = u ' keyA section=sectionA file=/path/to/file ' ,
expected = [ u ' keyA' , u ' section=sectionA ' , u ' file=/path/to/file ' ] ,
expected = [ u ' file=/path/to/file' , u ' keyA' , u ' section=sectionA ' ] ,
) ,
) ,
dict (
dict (
term = u ' keyB section=sectionB with space file=/path/with/embedded spaces and/file ' ,
term = u ' keyB section=sectionB with space file=/path/with/embedded spaces and/file ' ,
expected = [ u ' keyB' , u ' section=sectionB with space ' , u ' file=/path/with/embedded spaces and/fil e' ] ,
expected = [ u ' file=/path/with/embedded spaces and/file' , u ' keyB ' , u ' section=sectionB with spac e' ] ,
) ,
) ,
dict (
dict (
term = u ' keyC section=sectionC file=/path/with/equals/cn=com.ansible ' ,
term = u ' keyC section=sectionC file=/path/with/equals/cn=com.ansible ' ,
expected = [ u ' keyC' , u ' section=sectionC ' , u ' file=/path/with/equals/cn=com.ansible ' ] ,
expected = [ u ' file=/path/with/equals/cn=com.ansible' , u ' keyC ' , u ' section=sectionC ' ] ,
) ,
) ,
dict (
dict (
term = u ' keyD section=sectionD file=/path/with space and/equals/cn=com.ansible ' ,
term = u ' keyD section=sectionD file=/path/with space and/equals/cn=com.ansible ' ,
expected = [ u ' keyD' , u ' section=sectionD ' , u ' file=/path/with space and/equals/cn=com.ansible' ] ,
expected = [ u ' file=/path/with space and/equals/cn=com.ansible' , u ' keyD ' , u ' section=sectionD ' ] ,
) ,
) ,
dict (
dict (
term = u ' keyE section=sectionE file=/path/with/unicode/くらとみ/file ' ,
term = u ' keyE section=sectionE file=/path/with/unicode/くらとみ/file ' ,
expected = [ u ' keyE' , u ' section=sectionE ' , u ' file=/path/with/unicode/くらとみ/file ' ] ,
expected = [ u ' file=/path/with/unicode/くらとみ/file' , u ' keyE ' , u ' section=sectionE ' ] ,
) ,
) ,
dict (
dict (
term = u ' keyF section=sectionF file=/path/with/utf 8 and spaces/くらとみ/file ' ,
term = u ' keyF section=sectionF file=/path/with/utf 8 and spaces/くらとみ/file ' ,
expected = [ u ' keyF' , u ' section=sectionF ' , u ' file=/path/with/utf 8 and spaces/くらとみ/file' ] ,
expected = [ u ' file=/path/with/utf 8 and spaces/くらとみ/file' , u ' keyF ' , u ' section=sectionF ' ] ,
) ,
) ,
)
)
@ -65,4 +65,5 @@ class TestINILookup(unittest.TestCase):
for testcase in self . old_style_params_data :
for testcase in self . old_style_params_data :
# print(testcase)
# print(testcase)
params = _parse_params ( testcase [ ' term ' ] )
params = _parse_params ( testcase [ ' term ' ] )
params . sort ( )
self . assertEqual ( params , testcase [ ' expected ' ] )
self . assertEqual ( params , testcase [ ' expected ' ] )