diff options
| author | Jeremy Dunck <jdunck@gmail.com> | 2007-03-23 16:35:57 +0000 |
|---|---|---|
| committer | Jeremy Dunck <jdunck@gmail.com> | 2007-03-23 16:35:57 +0000 |
| commit | fa3ed6e1341f7c8b468e2267b3fafddeb58cdac2 (patch) | |
| tree | 6d8bf65854f8431355e2d91cbc61a37ab6f23d9a /tests/regressiontests/datastructures/tests.py | |
| parent | 8b279b63bef5c1348cc27c50633fc2d5ef09d7c1 (diff) | |
gis: Merged revisions 4669-4785 via svnmerge from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@4786 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/datastructures/tests.py')
| -rw-r--r-- | tests/regressiontests/datastructures/tests.py | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py index 624e7a50bf..e008c255f1 100644 --- a/tests/regressiontests/datastructures/tests.py +++ b/tests/regressiontests/datastructures/tests.py @@ -31,4 +31,35 @@ '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' +>>> d.keys() == d.copy().keys() +True + +### 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'] +""" |
