3 from wizard.util import *
5 class MyError(Exception):
13 assert dictmap(lambda x: x + 1, {'a': 0, 'b': 1}) == {'a': 1, 'b': 2}
15 def test_get_dir_uid():
16 if os.getuid(): return # only run if on a scripts server. This is crude
17 assert get_dir_uid("/mit/ezyang/web_scripts/test-wiki") == 537864399
19 def test_get_dir_uid_locker():
20 if os.getuid(): return
21 assert get_dir_uid("/mit/apo/web_scripts/") == 536956980
23 def test_get_exception_name():
25 raise NotImplementedError
26 except NotImplementedError:
27 assert get_exception_name(traceback.format_exc()) == "NotImplementedError"
29 def test_get_exception_name_withstr():
33 assert get_exception_name(traceback.format_exc()) == "MyError"