[Checkins] SVN: z3c.etestbrowser/trunk/ initial import

Christian Theune ct at gocept.com
Tue Dec 5 02:15:25 EST 2006


Log message for revision 71406:
   initial import
  

Changed:
  A   z3c.etestbrowser/trunk/
  A   z3c.etestbrowser/trunk/buildout.cfg
  A   z3c.etestbrowser/trunk/setup.py
  A   z3c.etestbrowser/trunk/src/
  A   z3c.etestbrowser/trunk/src/z3c/
  A   z3c.etestbrowser/trunk/src/z3c/etestbrowser/
  A   z3c.etestbrowser/trunk/src/z3c/etestbrowser/README.txt
  A   z3c.etestbrowser/trunk/src/z3c/etestbrowser/__init__.py
  A   z3c.etestbrowser/trunk/src/z3c/etestbrowser/testing.py
  A   z3c.etestbrowser/trunk/src/z3c/etestbrowser/tests.py

-=-
Added: z3c.etestbrowser/trunk/buildout.cfg
===================================================================
--- z3c.etestbrowser/trunk/buildout.cfg	2006-12-05 07:13:34 UTC (rev 71405)
+++ z3c.etestbrowser/trunk/buildout.cfg	2006-12-05 07:15:24 UTC (rev 71406)
@@ -0,0 +1,27 @@
+[buildout]
+develop = . 
+parts = zope3 database instance test
+
+[zope3]
+recipe = zc.recipe.zope3checkout
+url = svn://svn.zope.org/repos/main/Zope3/branches/3.3
+
+[database]
+recipe = zc.recipe.filestorage
+
+[instance]
+recipe = zc.recipe.zope3instance
+database = database
+user = admin:admin
+eggs = z3c.etestbrowser
+
+zcml = zope.app.securitypolicy-meta
+    zope.app.twisted
+    zope.app.authentication
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = z3c.etestbrowser
+working-directory = parts/instance
+extra-paths = parts/zope3/src
+defaults = ['--tests-pattern', '^f?tests$', '-v']


Property changes on: z3c.etestbrowser/trunk/buildout.cfg
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.etestbrowser/trunk/setup.py
===================================================================
--- z3c.etestbrowser/trunk/setup.py	2006-12-05 07:13:34 UTC (rev 71405)
+++ z3c.etestbrowser/trunk/setup.py	2006-12-05 07:15:24 UTC (rev 71406)
@@ -0,0 +1,21 @@
+from setuptools import setup, find_packages
+
+setup(
+    name='z3c.etestbrowser',
+    version='trunk',
+    author='Christian Theune',
+    author_email='ct at gocept.com',
+    url='svn://svn.zope.org/repos/main/z3c.etestbrowser',
+    description="""\
+Extensions for zope.testbrowser.
+""",
+    packages=find_packages('src'),
+    package_dir = {'': 'src'},
+    include_package_data = True,
+    zip_safe=False,
+    license='ZPL 2.1',
+
+    install_requires=['setuptools',
+                      'lxml'
+                     ],
+)


Property changes on: z3c.etestbrowser/trunk/setup.py
___________________________________________________________________
Name: svn:keywords
   + Id Rev Date
Name: svn:eol-style
   + native

Added: z3c.etestbrowser/trunk/src/z3c/etestbrowser/README.txt
===================================================================
--- z3c.etestbrowser/trunk/src/z3c/etestbrowser/README.txt	2006-12-05 07:13:34 UTC (rev 71405)
+++ z3c.etestbrowser/trunk/src/z3c/etestbrowser/README.txt	2006-12-05 07:15:24 UTC (rev 71406)
@@ -0,0 +1,34 @@
+====================
+Extended testbrowser
+====================
+
+This package provides some extensions to Zope 3's testbrowser. It is intended
+for extensions that have dependencies that we do not want to rely on in the
+  Zope 3 core e.g. lxml.
+
+
+Requirements
+============
+
+ - lxml
+
+
+EtreeTestBrowser
+================
+
+EtreeTestBrowser parses the result of a request into an etree using lxml (if
+it's text/html or text/xml).
+
+Useful to perform more detailed analysis of web pages using e.g. XPath and
+related XML technologies.
+
+Example:
+
+  >>> from z3c.etestbrowser.testing import EtreeTestBrowser
+  >>> browser = EtreeTestBrowser()
+  >>> browser.open("http://localhost/")
+  >>> browser.contents
+  >>> browser.etree
+  >>> browser.etree.xpath('//html')
+  []
+


Property changes on: z3c.etestbrowser/trunk/src/z3c/etestbrowser/README.txt
___________________________________________________________________
Name: svn:keywords
   + Id Rev Date
Name: svn:eol-style
   + native

Added: z3c.etestbrowser/trunk/src/z3c/etestbrowser/__init__.py
===================================================================
--- z3c.etestbrowser/trunk/src/z3c/etestbrowser/__init__.py	2006-12-05 07:13:34 UTC (rev 71405)
+++ z3c.etestbrowser/trunk/src/z3c/etestbrowser/__init__.py	2006-12-05 07:15:24 UTC (rev 71406)
@@ -0,0 +1 @@
+# make a package


Property changes on: z3c.etestbrowser/trunk/src/z3c/etestbrowser/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id Rev Date
Name: svn:eol-style
   + native

Added: z3c.etestbrowser/trunk/src/z3c/etestbrowser/testing.py
===================================================================
--- z3c.etestbrowser/trunk/src/z3c/etestbrowser/testing.py	2006-12-05 07:13:34 UTC (rev 71405)
+++ z3c.etestbrowser/trunk/src/z3c/etestbrowser/testing.py	2006-12-05 07:15:24 UTC (rev 71406)
@@ -0,0 +1,42 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Extensions for z3c.etestbrowser
+
+$Id$
+"""
+
+import lxml.etree
+
+import zope.testbrowser.testing
+
+
+html_parser = lxml.etree.HTMLParser()
+
+
+class EtreeTestBrowser(zope.testbrowser.testing.Browser):
+    """A testbrowser derivation that offers its content 
+    also as an etree.
+
+    """
+
+    @property
+    def etree(self):
+        if self._etree is not None:
+            return self._etree
+        self._etree = etree.parse(self.contents, html_parser)
+        return self._etree
+
+    def _changed(self):
+        super(EtreeTestBrowser, self)._changed()
+        self._etree = None


Property changes on: z3c.etestbrowser/trunk/src/z3c/etestbrowser/testing.py
___________________________________________________________________
Name: svn:keywords
   + Id Rev Date
Name: svn:eol-style
   + native

Added: z3c.etestbrowser/trunk/src/z3c/etestbrowser/tests.py
===================================================================
--- z3c.etestbrowser/trunk/src/z3c/etestbrowser/tests.py	2006-12-05 07:13:34 UTC (rev 71405)
+++ z3c.etestbrowser/trunk/src/z3c/etestbrowser/tests.py	2006-12-05 07:15:24 UTC (rev 71406)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Testing for z3c.etestbrowser
+
+$Id$
+"""
+
+import unittest
+
+from zope.app.testing import functional
+
+
+def test_suite():
+    return unittest.TestSuite(
+        functional.FunctionalDocFileSuite("README.txt"))


Property changes on: z3c.etestbrowser/trunk/src/z3c/etestbrowser/tests.py
___________________________________________________________________
Name: svn:keywords
   + Id Rev Date
Name: svn:eol-style
   + native



More information about the Checkins mailing list