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
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to