diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-03-08 09:28:45 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-03-08 09:28:45 +0000 |
| commit | 7d8687ea35bb588fabf7f756c70e86bc78831108 (patch) | |
| tree | 0cbc2cbb567ef29a44daf4234f624061d085b869 | |
| parent | 4823a531d15e60e1594cfc0c0d80653211d98409 (diff) | |
Fixed #3616 -- Added some more data structure tests from Chris McAvoy.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | tests/regressiontests/datastructures/tests.py | 31 |
1 files changed, 30 insertions, 1 deletions
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'] +""" |
