[Checkins] SVN: grokcore.view/new/src/grokcore/view/ftests/ Remove irrelevant ftests

Philipp von Weitershausen philikon at philikon.de
Sat Aug 2 09:32:04 EDT 2008


Log message for revision 89223:
  Remove irrelevant ftests
  

Changed:
  D   grokcore.view/new/src/grokcore/view/ftests/catalog/
  D   grokcore.view/new/src/grokcore/view/ftests/form/
  D   grokcore.view/new/src/grokcore/view/ftests/rest/
  D   grokcore.view/new/src/grokcore/view/ftests/site/
  U   grokcore.view/new/src/grokcore/view/ftests/test_grok_functional.py
  D   grokcore.view/new/src/grokcore/view/ftests/traversal/
  D   grokcore.view/new/src/grokcore/view/ftests/utility/
  D   grokcore.view/new/src/grokcore/view/ftests/viewlet/
  D   grokcore.view/new/src/grokcore/view/ftests/xmlrpc/

-=-
Modified: grokcore.view/new/src/grokcore/view/ftests/test_grok_functional.py
===================================================================
--- grokcore.view/new/src/grokcore/view/ftests/test_grok_functional.py	2008-08-02 13:27:07 UTC (rev 89222)
+++ grokcore.view/new/src/grokcore/view/ftests/test_grok_functional.py	2008-08-02 13:32:02 UTC (rev 89223)
@@ -1,16 +1,16 @@
-import re
 import unittest
-import grok
 import os.path
+import grokcore.view
 
 from pkg_resources import resource_listdir
-from zope.testing import doctest, renormalizing
+from zope.testing import doctest
 from zope.app.testing.functional import (HTTPCaller, getRootFolder,
                                          FunctionalTestSetup, sync, ZCMLLayer)
 
-ftesting_zcml = os.path.join(os.path.dirname(grok.__file__), 'ftesting.zcml')
-GrokFunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'GrokFunctionalLayer',
-                                allow_teardown=True)
+ftesting_zcml = os.path.join(os.path.dirname(grokcore.view.__file__),
+                             'ftesting.zcml')
+FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer',
+                            allow_teardown=True)
 
 def setUp(test):
     FunctionalTestSetup().setUp()
@@ -18,30 +18,6 @@
 def tearDown(test):
     FunctionalTestSetup().tearDown()
 
-checker = renormalizing.RENormalizing([
-    # Accommodate to exception wrapping in newer versions of mechanize
-    (re.compile(r'httperror_seek_wrapper:', re.M), 'HTTPError:'),
-    ])
-
-def http_call(method, path, data=None, **kw):
-    """Function to help make RESTful calls.
-
-    method - HTTP method to use
-    path - testbrowser style path
-    data - (body) data to submit
-    kw - any request parameters
-    """
-    
-    if path.startswith('http://localhost'):
-        path = path[len('http://localhost'):]
-    request_string = '%s %s HTTP/1.1\n' % (method, path)
-    for key, value in kw.items():
-        request_string += '%s: %s\n' % (key, value)
-    if data is not None:
-        request_string += '\r\n'
-        request_string += data
-    return HTTPCaller()(request_string, handle_errors=False)
-
 def suiteFromPackage(name):
     files = resource_listdir(__name__, name)
     suite = unittest.TestSuite()
@@ -51,29 +27,23 @@
         if filename == '__init__.py':
             continue
 
-        dottedname = 'grok.ftests.%s.%s' % (name, filename[:-3])
+        dottedname = 'grokcore.view.ftests.%s.%s' % (name, filename[:-3])
         test = doctest.DocTestSuite(
             dottedname, setUp=setUp, tearDown=tearDown,
-            checker=checker,
             extraglobs=dict(http=HTTPCaller(),
-                            http_call=http_call,
                             getRootFolder=getRootFolder,
                             sync=sync),
             optionflags=(doctest.ELLIPSIS+
                          doctest.NORMALIZE_WHITESPACE+
                          doctest.REPORT_NDIFF)
             )
-        test.layer = GrokFunctionalLayer
+        test.layer = FunctionalLayer
 
         suite.addTest(test)
     return suite
 
 def test_suite():
     suite = unittest.TestSuite()
-    for name in ['view', 'staticdir', 'xmlrpc', 'traversal', 'form', 'url',
-                 'security', 'utility', 'catalog', 'site', 'rest', 'viewlet']:
+    for name in ['view', 'staticdir', 'url', 'security']:
         suite.addTest(suiteFromPackage(name))
     return suite
-
-if __name__ == '__main__':
-    unittest.main(defaultTest='test_suite')



More information about the Checkins mailing list