| 91 | |
| 92 | >>> s.get('update key', None) |
| 93 | |
| 94 | test .update |
| 95 | >>> s.modified = s.accessed = False # Reset to pretend this wasn't accessed previously |
| 96 | >>> s.update({'update key':1}) |
| 97 | >>> s.accessed, s.modified |
| 98 | (True, True) |
| 99 | >>> s.get('update key', None) |
| 100 | 1 |
| 101 | |
| 102 | test .has_key |
| 103 | >>> s.modified = s.accessed = False # Reset to pretend this wasn't accessed previously |
| 104 | >>> s.has_key('update key') |
| 105 | True |
| 106 | >>> s.accessed, s.modified |
| 107 | (True, False) |
| 108 | |
| 109 | test .values |
| 110 | >>> s = SessionBase() |
| 111 | >>> s.values() |
| 112 | [] |
| 113 | >>> s.accessed |
| 114 | True |
| 115 | >>> s['x'] = 1 |
| 116 | >>> s.values() |
| 117 | [1] |
| 118 | |
| 119 | test .iterkeys |
| 120 | >>> s.accessed = False |
| 121 | >>> i = s.iterkeys() |
| 122 | >>> hasattr(i,'__iter__') |
| 123 | True |
| 124 | >>> s.accessed |
| 125 | True |
| 126 | >>> list(i) |
| 127 | ['x'] |
| 128 | |
| 129 | test .itervalues |
| 130 | >>> s.accessed = False |
| 131 | >>> i = s.itervalues() |
| 132 | >>> hasattr(i,'__iter__') |
| 133 | True |
| 134 | >>> s.accessed |
| 135 | True |
| 136 | >>> list(i) |
| 137 | [1] |
| 138 | |
| 139 | test .iteritems |
| 140 | >>> s.accessed = False |
| 141 | >>> i = s.iteritems() |
| 142 | >>> hasattr(i,'__iter__') |
| 143 | True |
| 144 | >>> s.accessed |
| 145 | True |
| 146 | >>> list(i) |
| 147 | [('x', 1)] |
| 148 | |
| 149 | |