[Zope3-dev] Re: Windows eggs
Benji York
benji at zope.com
Sun Jul 15 10:44:35 EDT 2007
Stephan Richter wrote:
> On Saturday 14 July 2007 15:30, Benji York wrote:
>> Yep, assertions about HTML (or XML) are difficult to do with plain text.
>> One option is to feed browser.contents to your favorite HTML (XML)
>> parser.
>
> Right, z3c.etestbrowser does this already. I wish they would have done this
> with a different object altogether, but they extended the TestBrowser class.
> But then I do not have enough objectstion to write a new package.
Perhaps someone can explain the utility of z3c.etestbrowser. As far as
I can see, it just adds an "etree" attribute to browser instances. That
doesn't seem to have much advantage over just calling etree on
browser.contents.
I'm doing some work with doctest right now, and am considering how to
make assertions about HTML/XML better. The programmatic approach like
above is one option. Another would be to use a special checker that
took into account HTML/XML structure. For example, it could interpret
ellipses differently such that
<foo ...>Text here</foo>
would match
<foo a="b">Text here</foo>
but not
<foo><bar/>Text here</foo>
--
Benji York
Senior Software Engineer
Zope Corporation
More information about the Zope3-dev
mailing list