[Checkins] SVN: bobo/trunk/b Tests pass w latest webob/webtest

jim cvs-admin at zope.org
Sun Apr 29 15:39:36 UTC 2012


Log message for revision 125400:
  Tests pass w latest webob/webtest

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

-=-
Modified: bobo/trunk/bobo/src/bobo.py
===================================================================
--- bobo/trunk/bobo/src/bobo.py	2012-04-29 15:38:40 UTC (rev 125399)
+++ bobo/trunk/bobo/src/bobo.py	2012-04-29 15:39:33 UTC (rev 125400)
@@ -240,8 +240,8 @@
 
         content_type = data.content_type
         response = webob.Response(status=data.status,
-                                  headerlist=data.headers,
-                                  content_type=content_type)
+                                  headerlist=data.headers)
+        response.content_type = content_type
 
         if method == 'HEAD':
             return response
@@ -250,12 +250,7 @@
         if isinstance(body, str):
             response.body = body
         elif _json_content_type(content_type):
-            try:
-                import json
-            except ImportError:
-                import simplejson
-                sys.modules['json'] = simplejson
-                json = simplejson
+            import json
             response.body = json.dumps(body)
         elif isinstance(body, unicode):
             response.unicode_body = body

Modified: bobo/trunk/bobodoctestumentation/setup.py
===================================================================
--- bobo/trunk/bobodoctestumentation/setup.py	2012-04-29 15:38:40 UTC (rev 125399)
+++ bobo/trunk/bobodoctestumentation/setup.py	2012-04-29 15:39:33 UTC (rev 125400)
@@ -29,5 +29,5 @@
     packages = ['bobodoctestumentation'],
     package_dir = {'':'src'},
     package_data = {'bobodoctestumentation': ['*.txt', '*.test', '*.html']},
-    install_requires = ['manuel', 'simplejson', 'webtest', 'zope.testing'],
+    install_requires = ['manuel', 'webtest', 'zope.testing'],
     )

Modified: bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/bobocalc.test
===================================================================
--- bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/bobocalc.test	2012-04-29 15:38:40 UTC (rev 125399)
+++ bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/bobocalc.test	2012-04-29 15:39:33 UTC (rev 125400)
@@ -34,10 +34,10 @@
 
     >>> print app.get('/add.json?value=0&input=42')
     Response: 200 OK
-    Content-Type: application/json
+    Content-Type: application/json; charset=UTF-8
     {"value": 42}
 
     >>> print app.get('/sub.json?value=42&input=42')
     Response: 200 OK
-    Content-Type: application/json
+    Content-Type: application/json; charset=UTF-8
     {"value": 0}

Modified: bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/decorator.test
===================================================================
--- bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/decorator.test	2012-04-29 15:38:40 UTC (rev 125399)
+++ bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/decorator.test	2012-04-29 15:39:33 UTC (rev 125400)
@@ -59,11 +59,11 @@
     {}
     >>> test('', '/')
     >>> test('', '/', partial=True)
-    '/'
+    u'/'
     {}
     >>> test('/', '/foo')
     >>> test('/', '/foo', partial=True)
-    'foo'
+    u'foo'
     {}
     >>> test('/foo', '/foo')
     {}
@@ -72,99 +72,99 @@
     {}
     >>> test('/foo/', '/foo/bar')
     >>> test('/foo/', '/foo/bar', '/bar')
-    'bar'
+    u'bar'
     {}
     >>> test('/foo', '/foo/bar', '/bar')
-    '/bar'
+    u'/bar'
     {}
     {}
     >>> test('/:x', '')
     >>> test('/:x', '/')
-    {'x': ''}
+    {'x': u''}
     >>> test('/:x', '/a')
-    {'x': 'a'}
+    {'x': u'a'}
     >>> test('/:x', '/aa')
-    {'x': 'aa'}
+    {'x': u'aa'}
     >>> test('/:xx', '')
     >>> test('/:xx', '/')
-    {'xx': ''}
+    {'xx': u''}
     >>> test('/:xx', '/a')
-    {'xx': 'a'}
+    {'xx': u'a'}
     >>> test('/:xx', '/aa')
-    {'xx': 'aa'}
+    {'xx': u'aa'}
     >>> test('/zzz/:xx', '/zzz')
     >>> test('/zzz/:xx', '/zzz/')
-    {'xx': ''}
+    {'xx': u''}
     >>> test('/zzz/:xx', '/zzz/a')
-    {'xx': 'a'}
+    {'xx': u'a'}
     >>> test('/zzz/:xx', '/zzz/aa')
-    {'xx': 'aa'}
+    {'xx': u'aa'}
     >>> test('/:xx/:y', '/a')
     >>> test('/:xx/:y', '/a/')
-    {'xx': 'a',
-     'y': ''}
+    {'xx': u'a',
+     'y': u''}
     >>> test('/:xx/:y', '/a/b')
-    {'xx': 'a',
-     'y': 'b'}
+    {'xx': u'a',
+     'y': u'b'}
     >>> test('/zzz/:xx/www/:y', '/a/b')
     >>> test('/zzz/:xx/www/:y', '/zzz/aa/www/bb')
-    {'xx': 'aa',
-     'y': 'bb'}
+    {'xx': u'aa',
+     'y': u'bb'}
     >>> test('/zzz/:xx/www/:y.html', '/zzz/aa/www/bb.html')
-    {'xx': 'aa',
-     'y': 'bb'}
+    {'xx': u'aa',
+     'y': u'bb'}
     >>> test('/zzz/:xx/www/:yy.html', '/zzz/aa/www/b.html')
-    {'xx': 'aa',
-     'yy': 'b'}
+    {'xx': u'aa',
+     'yy': u'b'}
     >>> test('/zzz/:xx?/www/:yy.html', '/zzz/aa/www/b.html')
-    {'xx': 'aa',
-     'yy': 'b'}
+    {'xx': u'aa',
+     'yy': u'b'}
     >>> test('/zzz/:xx?/www/:yy.html', '/zzz/www/b.html')
-    {'yy': 'b'}
+    {'yy': u'b'}
     >>> test('/zzz/:xx/www/:yy?.html', '/zzz/qq/www')
-    {'xx': 'qq'}
+    {'xx': u'qq'}
     >>> test('/zzz/:xx?/www/:yy?.html', '/zzz/www')
     {}
     >>> test('/zzz/:xx?/:yy?.html', '/zzz')
     {}
     >>> test('/zzz/:xx?/:yy?.html', '/zzz/')
-    {'xx': ''}
+    {'xx': u''}
     >>> test('/zzz/:xx?/:yy?', '/zzz')
     {}
     >>> test('/zzz/:xx?/www/:yy?.html', '/zzz/www/')
     >>> test('/zzz/:xx/www/:yy?', '/zzz/aaa/www')
-    {'xx': 'aaa'}
+    {'xx': u'aaa'}
     >>> test('/zzz/:xx/www/:yy?', '/zzz/aaa/www/')
-    {'xx': 'aaa',
-     'yy': ''}
+    {'xx': u'aaa',
+     'yy': u''}
     >>> test('/zzz/:xx/www/:yy?', '/zzz/aaa/www/bbb/ccc')
     >>> test('/zzz/:xx/www/:yy?', '/zzz/aaa/www/bbb/ccc', '/ccc')
-    '/ccc'
-    {'xx': 'aaa',
-     'yy': 'bbb'}
+    u'/ccc'
+    {'xx': u'aaa',
+     'yy': u'bbb'}
     {}
     >>> test('/zzz/:xx/www/:yy?', '/zzz/aaa/www/bbb/ccc', '/:foo')
-    '/ccc'
-    {'xx': 'aaa',
-     'yy': 'bbb'}
-    {'foo': 'ccc'}
+    u'/ccc'
+    {'xx': u'aaa',
+     'yy': u'bbb'}
+    {'foo': u'ccc'}
     >>> test('/zzz/:xx/www/:yy?', '/zzz/aaa/www/bbb/ccc', '/:foo/:bar?')
-    '/ccc'
-    {'xx': 'aaa',
-     'yy': 'bbb'}
-    {'foo': 'ccc'}
+    u'/ccc'
+    {'xx': u'aaa',
+     'yy': u'bbb'}
+    {'foo': u'ccc'}
     >>> test('/zzz/:xx/www/:yy?.html', '/zzz/aaa/www/bbb/ccc')
     >>> test('/zzz/:xx/www/:yy?.html', '/zzz/aaa/www/bbb/ccc', '/ccc')
-    '/bbb/ccc'
-    {'xx': 'aaa'}
+    u'/bbb/ccc'
+    {'xx': u'aaa'}
     >>> test('/zzz/:xx/www/:yy?.html', '/zzz/aaa/www/ccc', '/ccc')
-    '/ccc'
-    {'xx': 'aaa'}
+    u'/ccc'
+    {'xx': u'aaa'}
     {}
     >>> test('/zzz/:xx/www/:yy?.html', '/zzz/aaa/www/ccc', '/:ccc')
-    '/ccc'
-    {'xx': 'aaa'}
-    {'ccc': 'ccc'}
+    u'/ccc'
+    {'xx': u'aaa'}
+    {'ccc': u'ccc'}
 
 resource
 --------
@@ -233,7 +233,7 @@
     Host: localhost:80
     -----
     BoboException:
-    {'body': 'Hi bar.',
+    {'body': u'Hi bar.',
      'content_type': 'text/plain; charset=Latin-1',
      'headers': [],
      'status': 200}
@@ -341,14 +341,14 @@
 
     >>> call_resource(foo, '/a/b?bobo_request=1&x=2&y=3')
     BoboException:
-    {'body': 'Request b 3 None',
+    {'body': u'Request b 3 None',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
 
     >>> call_resource(foo, '/a?bobo_request=1&x=2&y=3')
     BoboException:
-    {'body': 'Request 2 3 None',
+    {'body': u'Request 2 3 None',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
@@ -361,7 +361,7 @@
 
     >>> call_resource(foo, '/a?bobo_request=1&x=2&y=3', 'y=4&z=5')
     BoboException:
-    {'body': "Request 2 ['3', '4'] 5",
+    {'body': u"Request 2 [u'3', u'4'] 5",
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
@@ -381,14 +381,14 @@
 
     >>> call_resource(foo, '/a?bobo_request=1&x=2&y=3', 'y=4&z=5&x=6')
     BoboException:
-    {'body': 'Request 6 4 5',
+    {'body': u'Request 6 4 5',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
 
     >>> call_resource(foo, '/a/b?bobo_request=1&x=2&y=3', 'y=4&z=5&x=6')
     BoboException:
-    {'body': 'Request b 4 5',
+    {'body': u'Request b 4 5',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
@@ -436,7 +436,7 @@
 
     >>> call_resource(C().m1, '/a/b')
     BoboException:
-    {'body': 'Request 99 b',
+    {'body': u'Request 99 b',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
@@ -462,7 +462,7 @@
 
     >>> call_resource(C().m2, '/b/b?z=3')
     BoboException:
-    {'body': '99 b 3',
+    {'body': u'99 b 3',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
@@ -516,7 +516,7 @@
     True
     >>> call_resource(C, '/x/a/b')
     BoboException:
-    {'body': 'Request 99 b',
+    {'body': u'Request 99 b',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
@@ -542,14 +542,14 @@
 
     >>> call_resource(C, '/pre/a/b')
     BoboException:
-    {'body': 'Request pre b',
+    {'body': u'Request pre b',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
 
     >>> call_resource(C, '/pro/b/c?z=1')
     BoboException:
-    {'body': 'pro c 1',
+    {'body': u'pro c 1',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
@@ -581,14 +581,14 @@
 
     >>> call_resource(C, '/pre')
     BoboException:
-    {'body': 'B.get GET pre None',
+    {'body': u'B.get GET pre None',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
 
     >>> call_resource(C, '/pre', method='POST')
     BoboException:
-    {'body': 'C.post POST pre None',
+    {'body': u'C.post POST pre None',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
@@ -600,14 +600,14 @@
 
     >>> call_resource(C, '/pre/a')
     BoboException:
-    {'body': 'B.gety GET pre a',
+    {'body': u'B.gety GET pre a',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
 
     >>> call_resource(C, '/pre/a', method='POST')
     BoboException:
-    {'body': 'C.posty POST pre a',
+    {'body': u'C.posty POST pre a',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}
@@ -884,7 +884,7 @@
     >>> call_resource(Events, '/eventswaaa')
     >>> call_resource(Events, '/events/1')
     BoboException:
-    {'body': 'id 1',
+    {'body': u'id 1',
      'content_type': 'text/html; charset=UTF-8',
      'headers': [],
      'status': 200}

Modified: bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/fswikia.test
===================================================================
--- bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/fswikia.test	2012-04-29 15:38:40 UTC (rev 125399)
+++ bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/fswikia.test	2012-04-29 15:39:33 UTC (rev 125400)
@@ -102,7 +102,7 @@
     Response: 302 Found
     Content-Type: text/html; charset=UTF-8
     Location: http://localhost/front
-    Set-Cookie: wiki=; expires="..."; Max-Age=0; Path=/
+    Set-Cookie: wiki=; Max-Age=0; Path=/; expires=...
     See http://localhost/front
 
     >>> app = webtest.TestApp(boboapp)

Modified: bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/main.test
===================================================================
--- bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/main.test	2012-04-29 15:38:40 UTC (rev 125399)
+++ bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/main.test	2012-04-29 15:39:33 UTC (rev 125400)
@@ -147,7 +147,7 @@
     <BLANKLINE>
 
     >>> print app.get('/there/x/y/z', status=200).body
-    {'where': 'there'}
+    {'where': u'there'}
 
 Note classes that define bobo_response instance methods aren't
 found via module scanning:

Modified: bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/more.txt
===================================================================
--- bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/more.txt	2012-04-29 15:38:40 UTC (rev 125399)
+++ bobo/trunk/bobodoctestumentation/src/bobodoctestumentation/more.txt	2012-04-29 15:39:33 UTC (rev 125400)
@@ -40,7 +40,7 @@
 
     >>> import pprint
     >>> pprint.pprint(helloapp.data, width=1)
-    {'foo': u'sometext',
+    {u'foo': u'sometext',
      'x': 'some text'}
 
 In this example, we use a very simple authorization model.  We can

Modified: bobo/trunk/buildout.cfg
===================================================================
--- bobo/trunk/buildout.cfg	2012-04-29 15:38:40 UTC (rev 125399)
+++ bobo/trunk/buildout.cfg	2012-04-29 15:39:33 UTC (rev 125400)
@@ -1,7 +1,6 @@
 [buildout]
 develop = bobo bobodoctestumentation
 parts = test sphinx bobo paste
-versions = versions
 
 [bobo]
 recipe = zc.recipe.egg
@@ -15,30 +14,6 @@
        webtest
        bobo
 
-[test2.4]
-recipe = zc.recipe.testrunner
-eggs = bobodoctestumentation
-       webtest
-       PasteDeploy
-       Paste
-       bobo
-
-python = python2.4
-
-[test2.5]
-recipe = zc.recipe.testrunner
-eggs = bobodoctestumentation
-       webtest
-       bobo
-python = python2.5
-
-[test2.6]
-recipe = zc.recipe.testrunner
-eggs = bobodoctestumentation
-       webtest
-       bobo
-python = python2.6
-
 [sphinx]
 recipe = zc.recipe.egg
 eggs = sphinx
@@ -52,12 +27,3 @@
 eggs = PasteScript
        repoze.who
        bobodoctestumentation
-
-[versions]
-webtest = 1.2
-zope.testing = 3.8.6
-zope.interface = 3.5.3
-zope.exceptions = 3.5.2
-WebOb = 0.9.7.1
-simplejson = 2.0.9
-manuel = 1.0.4



More information about the checkins mailing list