diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py index 624e7a50bf..90fb2d56a2 100644 --- a/tests/regressiontests/datastructures/tests.py +++ b/tests/regressiontests/datastructures/tests.py @@ -31,4 +31,33 @@ 'nonexistent' >>> d.setlist('lastname', ['Holovaty', 'Willison']) -""" \ No newline at end of file +### SortedDict ################################################################# + +>>> d = SortedDict() +>>> d['one'] = 'one' +>>> d['two'] = 'two' +>>> d['three'] = 'three' +>>> d['one'] +'one' +>>> d['two'] +'two' +>>> d['three'] +'three' +>>> d.keys() +['one', 'two', 'three'] +>>> d.values() +['one', 'two', 'three'] +>>> d['one'] = 'not one' +>>> d['one'] +'not one' + +### DotExpandedDict ############################################################ + +>>> d = DotExpandedDict({'person.1.firstname': ['Simon'], 'person.1.lastname': ['Willison'], 'person.2.firstname': ['Adrian'], 'person.2.lastname': ['Holovaty']}) +>>> d['person']['1']['lastname'] +['Willison'] +>>> d['person']['2']['lastname'] +['Holovaty'] +>>> d['person']['2']['firstname'] +['Adrian'] +"""