Failed example Hierarchy validate key value Expected Traceback most re

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
Failed example:
Hierarchy.validate([{'key':'value'}])
Expected:
Traceback (most recent call last):
...
ValueError: level {'key': 'value'} doesn't have 'name' key
Got:
Traceback (most recent call last):
File "/usr/lib/python2.5/doctest.py", line 1228, in __run
compileflags, 1) in test.globs
File "<doctest __main__.Hierarchy.validate[2]>", line 1, in <module>
Hierarchy.validate([{'key':'value'}])
File "mai_questionary.py", line 127, in validate
raise ValueError, e.message
ValueError: level {'key': 'value'} doesn't have 'name' key