Ticket #3616: datastructures_test.patch

File datastructures_test.patch, 1.1 KB (added by chris.mcavoy@…, 8 years ago)

patch file that adds a few more tests to regressiontests/datastructures/tests.py

  • tests/regressiontests/datastructures/tests.py

     
    3131'nonexistent'
    3232>>> d.setlist('lastname', ['Holovaty', 'Willison'])
    3333
    34 """
    35  No newline at end of file
     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"""
Back to Top