summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Delaney <idella4@gentoo.org>2015-08-16 13:32:33 +0800
committerIan Delaney <idella4@gentoo.org>2015-08-16 13:32:33 +0800
commit5af0dc4424114509ec3e5277d7a7690f23f8cdfd (patch)
tree3c4628e9672dc8e19f811eb49fc57b8a664416d8 /dev-python/beaker
parentdev-php/PEAR-PEAR: Version bump for PHP7 compatible version (diff)
downloadgentoo-5af0dc4424114509ec3e5277d7a7690f23f8cdfd.tar.gz
gentoo-5af0dc4424114509ec3e5277d7a7690f23f8cdfd.tar.bz2
gentoo-5af0dc4424114509ec3e5277d7a7690f23f8cdfd.zip
dev-python/beaker: patch to fix failed test, fixes bug #557026
Package-Manager: portage-2.2.20
Diffstat (limited to 'dev-python/beaker')
-rw-r--r--dev-python/beaker/beaker-1.7.0-r1.ebuild5
-rw-r--r--dev-python/beaker/files/beaker-1.7.0-cookie-testfix.patch40
2 files changed, 45 insertions, 0 deletions
diff --git a/dev-python/beaker/beaker-1.7.0-r1.ebuild b/dev-python/beaker/beaker-1.7.0-r1.ebuild
index 13b2fe6c5a21..032a14b06487 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 000000000000..364d112b45a4
--- /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():
+