[Python-modules-commits] [python-restless] 04/07: merge patched into master

Wolfgang Borgert debacle at moszumanska.debian.org
Mon Dec 26 03:21:02 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository python-restless.

commit 292c416a54eced1af38f459579c1847c126b4ea6
Merge: 7497e30 7a2742e
Author: W. Martin Borgert <debacle at debian.org>
Date:   Mon Dec 26 02:46:47 2016 +0000

    merge patched into master

 .gitignore                                        |  8 ++-
 .travis.yml                                       | 13 ++--
 AUTHORS                                           | 19 ++++++
 README.rst                                        | 40 +++++-------
 debian/.git-dpm                                   |  6 +-
 debian/patches/0001-fix-test-fail.patch           | 76 ++++++---------------
 debian/patches/0002-Django-1.10-compat-from.patch | 44 -------------
 debian/patches/series                             |  1 -
 docs/conf.py                                      | 11 ++--
 docs/cookbook.rst                                 |  8 +++
 docs/extending.rst                                |  8 +--
 docs/index.rst                                    |  5 +-
 docs/releasenotes/v2.0.2.rst                      | 36 ++++++++++
 docs/releasenotes/v2.0.3.rst                      | 14 ++++
 docs/tutorial.rst                                 | 14 ++--
 examples/django/posts/urls.py                     |  6 +-
 restless/__init__.py                              |  3 +-
 restless/constants.py                             | 14 ++++
 restless/dj.py                                    | 28 ++++----
 restless/exceptions.py                            | 80 ++++++++++++++++++++++-
 restless/fl.py                                    | 10 ++-
 restless/it.py                                    | 13 +++-
 restless/preparers.py                             |  4 +-
 restless/pyr.py                                   | 13 +++-
 restless/resources.py                             | 27 +++-----
 restless/serializers.py                           | 10 ++-
 restless/tnd.py                                   | 12 +++-
 restless/utils.py                                 |  4 +-
 rtfd-requirements.txt                             |  1 +
 setup.py                                          |  5 +-
 test2_requirements.txt                            |  3 -
 test3_requirements.txt                            |  8 ---
 tests/test_dj.py                                  | 71 +++++++++++++++-----
 tests/test_fl.py                                  | 27 ++++----
 tests/test_it.py                                  | 19 +++---
 tests/test_preparers.py                           | 10 ++-
 tests/test_pyr.py                                 | 26 +++++---
 tests/test_resources.py                           |  8 +--
 tests/test_serializers.py                         |  7 ++
 tests/test_tnd.py                                 | 68 +++++++++++++------
 tox.ini                                           | 29 ++++++++
 41 files changed, 510 insertions(+), 299 deletions(-)

diff --cc debian/.git-dpm
index 055e95a,0000000..04074e4
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,11 -1,0 +1,11 @@@
 +# see git-dpm(1) from git-dpm package
- 130057ffd2fbcdfef96a4c286925b38b8f81e2e2
- 130057ffd2fbcdfef96a4c286925b38b8f81e2e2
- 9e101c7e3823f117d7d3aa2425d8576d918a616c
++7a2742ece40f1014a0093ba37a7f0ca4cc715b2a
++7a2742ece40f1014a0093ba37a7f0ca4cc715b2a
++15a5e04ae4fc0a19a8d512bbf6ccec7e4cb618a4
 +15a5e04ae4fc0a19a8d512bbf6ccec7e4cb618a4
 +python-restless_2.0.3.orig.tar.gz
 +65fcf795b8788469e6035795ab6db8d5f4b5df76
 +49740
 +debianTag="debian/%e%v"
 +patchedTag="patched/%e%v"
 +upstreamTag="upstream/%e%u"
diff --cc debian/patches/0001-fix-test-fail.patch
index bf6d049,0000000..a0b81fa
mode 100644,000000..100644
--- a/debian/patches/0001-fix-test-fail.patch
+++ b/debian/patches/0001-fix-test-fail.patch
@@@ -1,81 -1,0 +1,43 @@@
- From d3c1ef683003b1fb6a49cc88a4f31971102232da Mon Sep 17 00:00:00 2001
++From 7a2742ece40f1014a0093ba37a7f0ca4cc715b2a Mon Sep 17 00:00:00 2001
 +From: mission-liao <missionaryliao at gmail.com>
 +Date: Fri, 27 Nov 2015 16:56:03 +0800
 +Subject: fix test fail
 +
 +after tornado 4.0, we need to provide a connection when faking a request
 +- and a context object for 4.0.1/4.0.2
 +---
-  tests/test_tnd.py | 42 +++++++++++++++++++++++++++++++++++++++---
-  1 file changed, 39 insertions(+), 3 deletions(-)
++ tests/test_tnd.py | 21 +++++++++++++++++++++
++ 1 file changed, 21 insertions(+)
 +
 +diff --git a/tests/test_tnd.py b/tests/test_tnd.py
- index 6d8d0a7..4011fc1 100644
++index 3d53f06..9f0ccde 100644
 +--- a/tests/test_tnd.py
 ++++ b/tests/test_tnd.py
- @@ -1,10 +1,33 @@
-  import unittest
- +import socket
- +import six
++@@ -17,6 +17,27 @@ def _newer_or_equal_(v):
++             return False
++     return True
 + 
-  from restless.tnd import TornadoResource, _BridgeMixin
-  from restless.utils import json
- -from tornado import testing, web, httpserver, gen
- +from tornado import testing, web, httpserver, gen, version_info
- +from tornado.iostream import IOStream
-  from restless.constants import UNAUTHORIZED
-  
- +def _newer_or_equal_(v):
- +    for i in six.moves.xrange(min(len(v), len(version_info))):
- +        expected, tnd = v[i], version_info[i]
- +        if tnd > expected:
- +            return True
- +        elif tnd == expected:
- +            continue
- +        else:
- +            return False
- +    return True
- +
 ++def _equal_(v):
 ++    for i in six.moves.xrange(min(len(v), len(version_info))):
 ++        if v[i] != version_info[i]:
 ++            return False
 ++    return True
 ++
 ++
 ++if _newer_or_equal_((4, 0, 0, 0)):
 ++    from tornado.http1connection import HTTP1Connection
-  
-  class TndBaseTestResource(TornadoResource):
-      """
- @@ -127,7 +150,7 @@ class TndResourceTestCase(BaseHTTPTestCase):
-  
-  class BaseTestCase(unittest.TestCase):
-      """
- -    test case that export the wrapped tornado.web.RequestHandler
- +    test case that export the wrapped tornado.web.RequestHandler.
-      """
-      def init_request_handler(self, rh_cls, view_type):
-          global app
- @@ -136,7 +159,20 @@ class BaseTestCase(unittest.TestCase):
-          elif view_type == 'detail':
-              rq = rh_cls.as_detail()
-  
- -        fake_request = httpserver.HTTPRequest('GET', '/fake', body='test123')
- +        # compose a fake incoming request
- +        fake_connection = None
 ++
- +        # after tornado 4.1, it's not allowed to build a RequestHandler without a connection.
- +        if _newer_or_equal_((4, 0, 0, 0)):
- +            ios = IOStream(socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0))
- +            context = None
+++def _newer_or_equal_(v):
+++    for i in six.moves.xrange(min(len(v), len(version_info))):
+++        expected, tnd = v[i], version_info[i]
+++        if tnd > expected:
+++            return True
+++        elif tnd == expected:
+++            continue
+++        else:
+++            return False
+++    return True
 ++
- +            # there is a bug in these 2 version that would fail when
- +            # context is None
- +            if _equal_((4, 0, 1)) or _equal_((4, 0, 2)):
- +                context = httpserver._HTTPRequestContext(ios, None, None)
- +            fake_connection = HTTP1Connection(ios, False, context=context)
- +        fake_request = httpserver.HTTPRequest('GET', '/fake', body='test123', connection=fake_connection)
-          self.new_handler = rq(app, fake_request)
-  
 + 
++ def _equal_(v):
++     for i in six.moves.xrange(min(len(v), len(version_info))):
diff --cc debian/patches/series
index 0fc3dc8,0000000..dd98f88
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,2 -1,0 +1,1 @@@
 +0001-fix-test-fail.patch
- 0002-Django-1.10-compat-from.patch
diff --cc tests/test_tnd.py
index 4011fc1,9f0ccde..3d53f06
--- a/tests/test_tnd.py
+++ b/tests/test_tnd.py
@@@ -2,14 -2,33 +2,12 @@@ import unittes
  import socket
  import six
  
- from restless.tnd import TornadoResource, _BridgeMixin
  from restless.utils import json
- from tornado import testing, web, httpserver, gen, version_info
- from tornado.iostream import IOStream
  from restless.constants import UNAUTHORIZED
  
+ 
  def _newer_or_equal_(v):
      for i in six.moves.xrange(min(len(v), len(version_info))):
 -        expected, tnd = v[i], version_info[i]
 -        if tnd > expected:
 -            return True
 -        elif tnd == expected:
 -            continue
 -        else:
 -            return False
 -    return True
 -
 -def _equal_(v):
 -    for i in six.moves.xrange(min(len(v), len(version_info))):
 -        if v[i] != version_info[i]:
 -            return False
 -    return True
 -
 -
 -if _newer_or_equal_((4, 0, 0, 0)):
 -    from tornado.http1connection import HTTP1Connection
 -
 -def _newer_or_equal_(v):
 -    for i in six.moves.xrange(min(len(v), len(version_info))):
          expected, tnd = v[i], version_info[i]
          if tnd > expected:
              return True

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-restless.git



More information about the Python-modules-commits mailing list