Re: [Rest2web-develop] Goodbye....
Brought to you by:
mjfoord
From: Nicola L. <ni...@te...> - 2005-07-10 11:34:52
|
> Well, That's it. I'm off to Romania. Great, enjoy your vacation. > I will still have email though :-) Maybe you'll wish you did not... ;-) > I've now changed the validate support in ConfigObj - so I just need to > make the corresponding changes in validate.py - not very difficult. > It's just about return values and then coding some nice examples. Upon your return, you'll find validate.py rather changed. :-) I'm not confining myself to style cleanups any more, here's the changelog: > 2005/07/10 > By Nicola Larosa > Tests converted to doctest format and placed in the respective docstrings, > so they are automatically checked, and easier to update > Added many (code) tests, and made test_* methods more robust > Added test_title to Validator.functions dict > log_err method added to Validator class, and used in re_set method; it > outputs to stdout instead of stderr, for testing reasons > Validator.functions dict and test functions reordered alphabetically > Some more code cleanup Now when you run $ python validate.py there's no output anymore. But if you run $ python validate.py -v you get a long display ending with: > 9 items had no tests: > __main__ > __main__.Validator.__init__ > __main__.Validator._none > __main__.Validator.function_parse > __main__.Validator.function_test > __main__.Validator.log_err > __main__.Validator.test > __main__._test > __main__._test_range > 24 items passed all tests: > 4 tests in __main__.Validator > 1 tests in __main__.Validator.getargs > 1 tests in __main__.Validator.re_set > 9 tests in __main__.Validator.re_test > 3 tests in __main__.Validator.test_multiple > 1 tests in __main__.Validator.tests > 1 tests in __main__.Validator.validate > 2 tests in __main__.metatest > 2 tests in __main__.test_alnum > 2 tests in __main__.test_alpha > 3 tests in __main__.test_complex > 2 tests in __main__.test_digit > 3 tests in __main__.test_float > 2 tests in __main__.test_floatrange > 4 tests in __main__.test_int > 2 tests in __main__.test_intrange > 1 tests in __main__.test_length > 1 tests in __main__.test_list > 2 tests in __main__.test_lower > 1 tests in __main__.test_option > 3 tests in __main__.test_size > 2 tests in __main__.test_string > 3 tests in __main__.test_title > 5 tests in __main__.test_upper > 60 tests in 33 items. > 60 passed and 0 failed. > Test passed. Rather nice, isn't it? :-D I know we didn't discuss this change before, and you stated, in the TODO section, your intention of using unit testing, but the doctest approach seems nicer to me, and it can be easily integrated in a larger unit testing framework anyway. (I'll leave the other points up for discussion when you're back.) > Have a good time..... (I will) Yes, I am, as you can see. Now on to tackle configreader.py... -- Nicola Larosa - ni...@te... Adding things just because you can leads to monstrosities like Common LISP, PL/I, Algol 68 and Perl 6. Adding features only when they add functionality (or better yet, by removing restrictions) leads to jewels like Python, Scheme and Eiffel. -- Mike Meyer, comp.lang.python, April 2005 |