Skip to content

Commit

Permalink
Merge branch 'fix.981-backport' into 1.4-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerickel committed Apr 19, 2013
2 parents f89644d + 0f1f512 commit 04f989b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Bug Fixes
of invoking the ``permits`` method of the authorization policy.
See https://github.com/Pylons/pyramid/issues/954

- Pyramid failed to install on some systems due to being packaged with
some test files containing higher order characters in their names. These
files have now been removed. See
https://github.com/Pylons/pyramid/issues/981

1.4 (2012-12-18)
================

Expand Down
1 change: 0 additions & 1 deletion pyramid/tests/fixtures/static/héhé.html

This file was deleted.

1 change: 0 additions & 1 deletion pyramid/tests/fixtures/static/héhé/index.html

This file was deleted.

45 changes: 28 additions & 17 deletions pyramid/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import datetime
import locale
import os
import platform
import unittest

from pyramid.wsgi import wsgiapp
Expand Down Expand Up @@ -82,27 +81,40 @@ def test_hidden(self):
res = self.testapp.get('/static/.hiddenfile', status=200)
_assertBody(res.body, os.path.join(here, 'fixtures/static/.hiddenfile'))

if defaultlocale is not None and platform.system() == 'Linux':
if defaultlocale is not None:
# These tests are expected to fail on LANG=C systems due to decode
# errors and on non-Linux systems due to git highchar handling
# vagaries
def test_highchars_in_pathelement(self):
url = url_quote('/static/héhé/index.html')
res = self.testapp.get(url, status=200)
_assertBody(
res.body,
os.path.join(here,
text_('fixtures/static/héhé/index.html', 'utf-8'))
)
path = os.path.join(
here,
text_('fixtures/static/héhé/index.html', 'utf-8'))
pathdir = os.path.dirname(path)
body = b'<html>hehe</html>\n'
try:
os.makedirs(pathdir)
with open(path, 'wb') as fp:
fp.write(body)
url = url_quote('/static/héhé/index.html')
res = self.testapp.get(url, status=200)
self.assertEqual(res.body, body)
finally:
os.unlink(path)
os.rmdir(pathdir)

def test_highchars_in_filename(self):
url = url_quote('/static/héhé.html')
res = self.testapp.get(url, status=200)
_assertBody(
res.body,
os.path.join(here,
text_('fixtures/static/héhé.html', 'utf-8'))
)
path = os.path.join(
here,
text_('fixtures/static/héhé.html', 'utf-8'))
body = b'<html>hehe file</html>\n'
with open(path, 'wb') as fp:
fp.write(body)
try:
url = url_quote('/static/héhé.html')
res = self.testapp.get(url, status=200)
self.assertEqual(res.body, body)
finally:
os.unlink(path)

def test_not_modified(self):
self.testapp.extra_environ = {
Expand Down Expand Up @@ -663,4 +675,3 @@ def _assertBody(body, filename):
data = data.replace(b'\r', b'')
data = data.replace(b'\n', b'')
assert(body == data)

0 comments on commit 04f989b

Please sign in to comment.