Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit 7d8687ea35bb588fabf7f756c70e86bc78831108 1 parent 4823a53
Malcolm Tredinnick authored March 08, 2007
31  tests/regressiontests/datastructures/tests.py
@@ -31,4 +31,33 @@
31 31
 'nonexistent'
32 32
 >>> d.setlist('lastname', ['Holovaty', 'Willison'])
33 33
 
34  
-"""
  34
+### SortedDict #################################################################
  35
+
  36
+>>> d = SortedDict()
  37
+>>> d['one'] = 'one'
  38
+>>> d['two'] = 'two'
  39
+>>> d['three'] = 'three'
  40
+>>> d['one']
  41
+'one'
  42
+>>> d['two']
  43
+'two'
  44
+>>> d['three']
  45
+'three'
  46
+>>> d.keys()
  47
+['one', 'two', 'three']
  48
+>>> d.values()
  49
+['one', 'two', 'three']
  50
+>>> d['one'] = 'not one'
  51
+>>> d['one']
  52
+'not one'
  53
+
  54
+### DotExpandedDict ############################################################
  55
+
  56
+>>> d = DotExpandedDict({'person.1.firstname': ['Simon'], 'person.1.lastname': ['Willison'], 'person.2.firstname': ['Adrian'], 'person.2.lastname': ['Holovaty']})
  57
+>>> d['person']['1']['lastname']
  58
+['Willison']
  59
+>>> d['person']['2']['lastname']
  60
+['Holovaty']
  61
+>>> d['person']['2']['firstname']
  62
+['Adrian']
  63
+"""

0 notes on commit 7d8687e

Please sign in to comment.
Something went wrong with that request. Please try again.