Re: [Rest2web-develop] Changed all references to value "tests" into value "checks"...
Brought to you by:
mjfoord
|
From: Michael F. <mi...@pc...> - 2005-07-21 08:50:19
|
Nicola Larosa wrote:
> ...including the main Validator method, and all code tests.
>
> Also moved the "import socket, struct" line inside both the dottedQuadToNum
> and numToDottedQuad functions, and added tests to both of them.
>
> Speaking of the latter function, one of the tests allowed me catch a bug in
> it. I've been using that code for *years* now, I'm still shocked. :-)
>
> Repeat after me: doctest, unittest, whatever, but test! ;-)
>
Great. All good.
I've done *some* work on ConfigObj - but not as much as I'd hoped.
Hopefully I'll get a couple of clear hours tonight.
I've fixed a couple of bugs - and uncovered two more, both of which I'm
not sure what to do with.
Only one of them *needs* a resolution now - the other one is minor and
I'll explain later.
It is possible to create new ConfigObjs programatically. Either manually
- or by passing in a dictionary to create the ConfigObj. In both cases
it is possible to create a ConfigObj where the first item is a section.
This means that when you call the ``write`` method the resulting config
file looks like :
[ section ]
key = value
key = value
Which is *invalid* !
My proposed solution is to have the ``write`` method check if the first
value is a section - and write out non-section values first (there may
not be any). This means not obeying sequence though, so it's not ideal.
Best Regards,
Fuzzy
http://www.voidspace.org.uk/python
|