diff options
| author | Michael Merickel <michael@merickel.org> | 2013-03-19 11:08:01 -0700 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2013-03-19 11:56:22 -0700 |
| commit | 5d9bf10e4e7895a75a285ef157e1af177977ceec (patch) | |
| tree | 6e9819c57db1604626c300c06c5195e3ff8566e8 | |
| parent | 37a603b04efca877bbbe382ef10ebee12045ea89 (diff) | |
| download | pyramid-5d9bf10e4e7895a75a285ef157e1af177977ceec.tar.gz pyramid-5d9bf10e4e7895a75a285ef157e1af177977ceec.tar.bz2 pyramid-5d9bf10e4e7895a75a285ef157e1af177977ceec.zip | |
remove files with higher order characters from the repo and fix tests
the 2 tests that use these files now generate them on the fly, this
should work on non-linux systems
| -rw-r--r-- | pyramid/tests/fixtures/static/héhé.html | 1 | ||||
| -rw-r--r-- | pyramid/tests/fixtures/static/héhé/index.html | 1 | ||||
| -rw-r--r-- | pyramid/tests/test_integration.py | 45 |
3 files changed, 28 insertions, 19 deletions
diff --git a/pyramid/tests/fixtures/static/héhé.html b/pyramid/tests/fixtures/static/héhé.html deleted file mode 100644 index fe5e9af50..000000000 --- a/pyramid/tests/fixtures/static/héhé.html +++ /dev/null @@ -1 +0,0 @@ -<html>hehe file</html> diff --git a/pyramid/tests/fixtures/static/héhé/index.html b/pyramid/tests/fixtures/static/héhé/index.html deleted file mode 100644 index 67623d866..000000000 --- a/pyramid/tests/fixtures/static/héhé/index.html +++ /dev/null @@ -1 +0,0 @@ -<html>hehe</html> diff --git a/pyramid/tests/test_integration.py b/pyramid/tests/test_integration.py index b880cd741..c8418c61d 100644 --- a/pyramid/tests/test_integration.py +++ b/pyramid/tests/test_integration.py @@ -3,7 +3,6 @@ import datetime import locale import os -import platform import unittest from pyramid.wsgi import wsgiapp @@ -82,27 +81,40 @@ class TestStaticAppBase(IntegrationBase): 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 = { @@ -689,4 +701,3 @@ def _assertBody(body, filename): data = data.replace(b'\r', b'') data = data.replace(b'\n', b'') assert(body == data) - |
