[Checkins] SVN: bobo/trunk/b Use latest manuel and webob.

Jim Fulton jim at zope.com
Mon Jan 18 15:05:20 EST 2010


Log message for revision 108223:
  Use latest manuel and webob.
  
  Moved some testing dependencies to bobodoctestumentation dependencies.
  

Changed:
  U   bobo/trunk/bobo/setup.py
  U   bobo/trunk/bobodoctestumentation/setup.py
  U   bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/decorator.test
  U   bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/index.txt
  U   bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/main.test
  U   bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/more.txt
  U   bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/tests.py
  U   bobo/trunk/buildout.cfg

-=-
Modified: bobo/trunk/bobo/setup.py
===================================================================
--- bobo/trunk/bobo/setup.py	2010-01-18 19:53:41 UTC (rev 108222)
+++ bobo/trunk/bobo/setup.py	2010-01-18 20:05:20 UTC (rev 108223)
@@ -53,7 +53,6 @@
     install_requires = install_requires,
     entry_points = entry_points,
     tests_require = [
-        'bobodoctestumentation >=%s, <%s.999' % (version, version),
-        'webtest', 'zope.testing'],
+        'bobodoctestumentation >=%s, <%s.999' % (version, version)],
     test_suite = 'bobodoctestumentation.tests.test_suite',
     )

Modified: bobo/trunk/bobodoctestumentation/setup.py
===================================================================
--- bobo/trunk/bobodoctestumentation/setup.py	2010-01-18 19:53:41 UTC (rev 108222)
+++ bobo/trunk/bobodoctestumentation/setup.py	2010-01-18 20:05:20 UTC (rev 108223)
@@ -29,5 +29,5 @@
     packages = ['bobodoctestumentation'],
     package_dir = {'':'src'},
     package_data = {'bobodoctestumentation': ['*.txt', '*.test', '*.html']},
-    install_requires = ['manuel ==1.0.0a2', 'simplejson'],
+    install_requires = ['manuel', 'simplejson', 'webtest', 'zope.testing'],
     )

Modified: bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/decorator.test
===================================================================
--- bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/decorator.test	2010-01-18 19:53:41 UTC (rev 108222)
+++ bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/decorator.test	2010-01-18 20:05:20 UTC (rev 108223)
@@ -173,7 +173,7 @@
     ... @bobo.resource('/:name', content_type='text/plain; charset=Latin-1')
     ... def hi(request, name=None):
     ...     print 'request:'
-    ...     print str(request).replace('\r', '')
+    ...     print str(request).replace('\r', '').rstrip()
     ...     print '-----'
     ...     return 'Hi %s.' % name
 

Modified: bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/index.txt
===================================================================
--- bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/index.txt	2010-01-18 19:53:41 UTC (rev 108222)
+++ bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/index.txt	2010-01-18 20:05:20 UTC (rev 108223)
@@ -87,13 +87,15 @@
 
     http://localhost:8080/hello.html
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
 you'll get the greeting::
 
     Hello world!
 
-.. -> expected_body strip
+.. -> expected_body
+  >>> expected_body = expected_body.strip()
 
     >>> app.get(url, status=200).body == expected_body
     True
@@ -105,7 +107,8 @@
 
     http://localhost:8080/
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
 We'll do this by providing a URL path::
 
@@ -148,13 +151,15 @@
 
     http://localhost:8080/?name=Sally
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
 We'll get the output::
 
    Hello Sally!
 
-.. -> expected_body strip
+.. -> expected_body
+  >>> expected_body = expected_body.strip()
 
     >>> app.get(url, status=200).body == expected_body
     True
@@ -290,13 +295,15 @@
 
     http://localhost:8080/greeters/myapp?name=Sally
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
 for which we get the output::
 
     Hello Sally! My name is myapp.
 
-.. -> expected_body strip
+.. -> expected_body
+  >>> expected_body = expected_body.strip()
 
     >>> app.get(url).body == expected_body
     True
@@ -326,13 +333,15 @@
 
     http://localhost:8080/greeters?name=Sally
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
 for which we get the output::
 
     Hello Sally! My name is Bobo.
 
-.. -> expected_body strip
+.. -> expected_body
+  >>> expected_body = expected_body.strip()
 
     >>> app.get(url).body == expected_body
     True
@@ -341,13 +350,15 @@
 
     http://localhost:8080/greeters/?name=Sally
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
 we get the output::
 
     Hello Sally! My name is .
 
-.. -> expected_body strip
+.. -> expected_body
+  >>> expected_body = expected_body.strip()
 
     >>> app.get(url).body == expected_body
     True
@@ -369,13 +380,15 @@
 
     http://localhost:8080/greeters/myapp.html?name=Sally
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
 And get::
 
     Hello Sally! My name is myapp.
 
-.. -> expected_body strip
+.. -> expected_body
+  >>> expected_body = expected_body.strip()
 
     >>> app.get(url).body == expected_body
     True
@@ -395,7 +408,8 @@
 
     http://localhost:8080/greeters?name=Sally
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
     >>> app.get(url, status=200).body
     'Hello Sally! My name is Bobo.'
@@ -404,7 +418,8 @@
 
     http://localhost:8080/greeters/jim.html?name=Sally
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
     >>> app.get(url, status=200).body
     'Hello Sally! My name is jim.'
@@ -486,7 +501,8 @@
 
     http://localhost:8080/employees/1/summary.html
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
     >>> print app.get(url).body
     <BLANKLINE>
@@ -510,13 +526,15 @@
 
     http://localhost:8080/employees/1
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
 which would redirect to::
 
     http://localhost:8080/employees/1/
 
-.. -> expected_location strip
+.. -> expected_location
+  >>> expected_location = expected_location.strip()
 
     >>> response = app.get(url, status=302)
     >>> response.headers['location'] == expected_location
@@ -590,13 +608,15 @@
 
     http://localhost:8080/employees/1/documents/hobbies/sports.html
 
-.. -> url strip
+.. -> url
+  >>> url = url.strip()
 
 which outputs::
 
     I like to ski.
 
-.. -> expected_body strip
+.. -> expected_body
+  >>> expected_body = expected_body.strip()
 
     >>> app.get(url).body == expected_body
     True

Modified: bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/main.test
===================================================================
--- bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/main.test	2010-01-18 19:53:41 UTC (rev 108222)
+++ bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/main.test	2010-01-18 20:05:20 UTC (rev 108223)
@@ -288,13 +288,13 @@
     >>> response # doctest: +ELLIPSIS
     <Response at ... 302 Found>
 
-    >>> print response
-    302 Found
-    Location: http://www.python.org/
-    Content-Type: text/html; charset=UTF-8
-    Content-Length: 26
+    >>> print str(response).lower()
+    302 found
+    location: http://www.python.org/
+    content-type: text/html; charset=utf-8
+    content-length: 26
     <BLANKLINE>
-    See http://www.python.org/
+    see http://www.python.org/
 
     >>> response = bobo.redirect('http://www.python.org/', 301)
     >>> response # doctest: +ELLIPSIS

Modified: bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/more.txt
===================================================================
--- bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/more.txt	2010-01-18 19:53:41 UTC (rev 108222)
+++ bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/more.txt	2010-01-18 20:05:20 UTC (rev 108223)
@@ -280,7 +280,8 @@
 
        Hi, I'm employee 1
 
-     .. -> expected1 strip
+     .. -> expected1
+       >>> expected1 = expected1.strip()
 
          >>> app.get(url1, status=200).body == expected1
          True
@@ -291,13 +292,15 @@
 
        http://localhost:8080/docs/bobs/hi.html
 
-     .. -> url2 strip
+     .. -> url2
+       >>> url2 = url2.strip()
 
      We'll get output::
 
        Hi. I'm Bob.
 
-     .. -> expected2 strip
+     .. -> expected2
+       >>> expected2 = expected2.strip()
 
          >>> app.get(url2, status=200).body == expected2
          True
@@ -309,13 +312,15 @@
 
         http://localhost:8080/long/winded/path/bobo/lets/get/on/with/it
 
-     .. -> url3 strip
+     .. -> url3
+       >>> url3 = url3.strip()
 
      We'll get output::
 
        Hi, I'm bobo
 
-     .. -> expected3 strip
+     .. -> expected3
+       >>> expected3 = expected3.strip()
 
          >>> app.get(url3, status=200).body == expected3
          True
@@ -326,13 +331,15 @@
 
         http://localhost:8080/us/1/
 
-     .. -> url4 strip
+     .. -> url4
+       >>> url4 = url4.strip()
 
      We'll get output::
 
        Hi, I'm employee 1
 
-     .. -> expected4 strip
+     .. -> expected4
+       >>> expected4 = expected4.strip()
 
          >>> app.get(url4, status=200).body == expected4
          True
@@ -343,13 +350,15 @@
 
         http://localhost:8080/folks/employee/1/
 
-     .. -> url5 strip
+     .. -> url5
+       >>> url5 = url5.strip()
 
      We'll get output::
 
        Hi, I'm employee 1
 
-     .. -> expected5 strip
+     .. -> expected5
+       >>> expected5 = expected5.strip()
 
          >>> app.get(url5, status=200).body == expected5
          True
@@ -360,13 +369,15 @@
 
         http://localhost:8080/ho/silly
 
-     .. -> url6 strip
+     .. -> url6
+       >>> url6 = url6.strip()
 
      We'll get output::
 
        Hi, I'm silly
 
-     .. -> expected6 strip
+     .. -> expected6
+       >>> expected6 = expected6.strip()
 
          >> app.get(url6, status=200).body == expected6
          True
@@ -611,7 +622,8 @@
 
    http://localhost:8080/hi.html?who=you
 
-.. -> url1 strip
+.. -> url1
+  >>> url1 = url1.strip()
 
 We'll get the response::
 
@@ -619,7 +631,8 @@
     Content-Type: text/html; charset=UTF-8
     Hi you
 
-.. -> expected1 strip
+.. -> expected1
+  >>> expected1 = expected1.strip()
 
     >>> str(app.get(url1)).strip() == expected1
     True
@@ -628,7 +641,8 @@
 
    http://localhost:8080/ho
 
-.. -> url2 strip
+.. -> url2
+  >>> url2 = url2.strip()
 
 We'll get::
 
@@ -636,7 +650,8 @@
     Content-Type: text/html; charset=UTF-8
     not found
 
-.. -> expected2 strip
+.. -> expected2
+  >>> expected2 = expected2.strip()
 
     >>> str(app.get(url2, status=404)).strip() == expected2
     True
@@ -645,7 +660,8 @@
 
    http://localhost:8080/hi.html
 
-.. -> url3 strip
+.. -> url3
+  >>> url3 = url3.strip()
 
 We'll get::
 
@@ -653,7 +669,8 @@
     Content-Type: text/html; charset=UTF-8
     Missing who
 
-.. -> expected3 strip
+.. -> expected3
+  >>> expected3 = expected3.strip()
 
     >>> str(app.get(url3)).strip() == expected3
     True
@@ -665,7 +682,8 @@
     Content-Type: text/plain
     bad method POST
 
-.. -> expected4 strip
+.. -> expected4
+  >>> expected4 = expected4.strip()
 
     >>> str(app.post(url3, 'who=me', status=405)).strip() == expected4
     True

Modified: bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/tests.py
===================================================================
--- bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/tests.py	2010-01-18 19:53:41 UTC (rev 108222)
+++ bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/tests.py	2010-01-18 20:05:20 UTC (rev 108223)
@@ -14,40 +14,14 @@
 
 from zope.testing import doctest, setupstack, renormalizing
 import bobo
-import manuel
+import manuel.capture
 import manuel.doctest
 import manuel.testing
-import pprint
 import re
 import sys
-import textwrap
 import types
 import unittest
-import webob
 
-def assignment_manuel():
-    assignment_re = re.compile(
-        r"[^\n]*::(?P<value>(\n| [^\n]*\n)+?)"
-        " *\.\. -> (?P<name>\w+)(?P<strip> +strip)? *\n")
-
-    m = manuel.Manuel()
-
-    @m.parser
-    def parse(document):
-        for region in document.find_regions(assignment_re):
-            data = region.start_match.groupdict()
-            data['value'] = textwrap.dedent(data['value'].expandtabs())
-            if data.get('strip'):
-                data['value'] = data['value'].strip()
-            source = "%(name)s = %(value)r\n" % data
-            example = doctest.Example(source, '', lineno=region.lineno-1)
-            document.replace_region(region, example)
-
-    m2 = manuel.doctest.Manuel()
-    m2.extend(m)
-
-    return m2
-
 def setUp(test):
     setupstack.setUpDirectory(test)
 
@@ -98,7 +72,7 @@
 def test_suite():
     return unittest.TestSuite((
         manuel.testing.TestSuite(
-            assignment_manuel(),
+            manuel.doctest.Manuel() + manuel.capture.Manuel(),
             'index.txt', 'more.txt',
             setUp=setup_intro),
         doctest.DocFileSuite(

Modified: bobo/trunk/buildout.cfg
===================================================================
--- bobo/trunk/buildout.cfg	2010-01-18 19:53:41 UTC (rev 108222)
+++ bobo/trunk/buildout.cfg	2010-01-18 20:05:20 UTC (rev 108223)
@@ -1,11 +1,7 @@
 [buildout]
 develop = bobo bobodoctestumentation
 parts = test sphinx bobo paste
-versions = versions
 
-[versions]
-manuel = 1.0.0a2
-
 [bobo]
 recipe = zc.recipe.egg
 eggs = bobo



More information about the checkins mailing list