[Python-modules-commits] [python-restless] 02/04: merge patched into master
Wolfgang Borgert
debacle at moszumanska.debian.org
Fri Jan 1 15:03:06 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 d6304740363856c5813be9dee2770401815a522a
Merge: ecff925 d3c1ef6
Author: W. Martin Borgert <debacle at debian.org>
Date: Tue Dec 8 21:52:20 2015 +0100
merge patched into master
debian/.git-dpm | 4 +-
debian/patches/0001-fix-test-fail.patch | 81 +++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
tests/test_tnd.py | 42 +++++++++++++++--
4 files changed, 123 insertions(+), 5 deletions(-)
diff --cc debian/.git-dpm
index 7319d04,0000000..8d396c5
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
- 9e101c7e3823f117d7d3aa2425d8576d918a616c
- 9e101c7e3823f117d7d3aa2425d8576d918a616c
++d3c1ef683003b1fb6a49cc88a4f31971102232da
++d3c1ef683003b1fb6a49cc88a4f31971102232da
+9e101c7e3823f117d7d3aa2425d8576d918a616c
+9e101c7e3823f117d7d3aa2425d8576d918a616c
+python-restless_2.0.1.orig.tar.gz
+c1319b4cec2e833751193acd066e2e14b7c60073
+46996
+debianTag="debian/%e%v"
+patchedTag="patched/%e%v"
+upstreamTag="upstream/%e%u"
diff --cc debian/patches/0001-fix-test-fail.patch
index 0000000,0000000..bf6d049
new file mode 100644
--- /dev/null
+++ b/debian/patches/0001-fix-test-fail.patch
@@@ -1,0 -1,0 +1,81 @@@
++From d3c1ef683003b1fb6a49cc88a4f31971102232da 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(-)
++
++diff --git a/tests/test_tnd.py b/tests/test_tnd.py
++index 6d8d0a7..4011fc1 100644
++--- a/tests/test_tnd.py
+++++ b/tests/test_tnd.py
++@@ -1,10 +1,33 @@
++ import unittest
+++import socket
+++import six
++
++ 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
+++
+++ # 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)
++
++
diff --cc debian/patches/series
index 0000000,0000000..dd98f88
new file mode 100644
--- /dev/null
+++ b/debian/patches/series
@@@ -1,0 -1,0 +1,1 @@@
++0001-fix-test-fail.patch
--
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