commit:     5af0dc4424114509ec3e5277d7a7690f23f8cdfd
Author:     Ian Delaney <idella4 <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 16 05:32:33 2015 +0000
Commit:     Ian Delaney <idella4 <AT> gentoo <DOT> org>
CommitDate: Sun Aug 16 05:32:33 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5af0dc44

dev-python/beaker: patch to fix failed test, fixes bug #557026

Package-Manager: portage-2.2.20

 dev-python/beaker/beaker-1.7.0-r1.ebuild           |  5 +++
 .../beaker/files/beaker-1.7.0-cookie-testfix.patch | 40 ++++++++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/dev-python/beaker/beaker-1.7.0-r1.ebuild 
b/dev-python/beaker/beaker-1.7.0-r1.ebuild
index 13b2fe6..032a14b 100644
--- a/dev-python/beaker/beaker-1.7.0-r1.ebuild
+++ b/dev-python/beaker/beaker-1.7.0-r1.ebuild
@@ -27,8 +27,13 @@ DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
        )"
 RDEPEND=""
 
+# Py2.7 fais some tests without this
+DISTUTILS_IN_SOURCE_BUILD=1
+
 S="${WORKDIR}/${P}dev"
 
+PATCHES=( "${FILESDIR}"/${P}-cookie-testfix.patch )
+
 python_prepare_all() {
        # Workaround for http://bugs.python.org/issue11276.
        sed -e "s/import anydbm/& as anydbm/;/import anydbm/a dbm = anydbm" \

diff --git a/dev-python/beaker/files/beaker-1.7.0-cookie-testfix.patch 
b/dev-python/beaker/files/beaker-1.7.0-cookie-testfix.patch
new file mode 100644
index 0000000..364d112
--- /dev/null
+++ b/dev-python/beaker/files/beaker-1.7.0-cookie-testfix.patch
@@ -0,0 +1,40 @@
+https://github.com/bbangert/beaker/commit/714f464cac9d14e338cf4420163292acaab3bb49
+diff --git a/beaker/session.py b/beaker/session.py
+index 10a87f2..f1a585f 100644
+--- a/beaker/session.py
++++ b/beaker/session.py
+@@ -226,7 +226,7 @@ def _create_id(self, set_new=True):
+             self.last_accessed = None
+         if self.use_cookies:
+             self._set_cookie_values()
+-            sc = set_new == False
++            sc = set_new is False
+             self._update_cookie_out(set_cookie=sc)
+ 
+     @property
+diff --git a/tests/test_session.py b/tests/test_session.py
+index 82ed74d..926dabb 100644
+--- a/tests/test_session.py
++++ b/tests/test_session.py
+@@ -218,7 +218,8 @@ def test_cookies_enabled():
+ 
+     # test for secure
+     session = get_session(use_cookies=True, secure=True)
+-    assert 'secure' in session.request['cookie_out']
++    cookie = session.request['cookie_out'].lower()  # Python3.4.3 outputs 
"Secure", while previous output "secure"
++    assert 'secure' in cookie, cookie
+ 
+     # test for httponly
+     class ShowWarning(object):
+@@ -233,7 +234,9 @@ def __call__(self, message, category, filename, lineno, 
file=None, line=None):
+     if sys.version_info < (2, 6):
+         assert sw.msg == 'Python 2.6+ is required to use httponly'
+     else:
+-        assert 'httponly' in session.request['cookie_out']
++        # Python3.4.3 outputs "HttpOnly", while previous output "httponly"
++        cookie = session.request['cookie_out'].lower()
++        assert 'httponly' in cookie, cookie
+     warnings.showwarning = orig_sw
+ 
+ def test_cookies_disabled():
+

Reply via email to