Flask-Compress-1.4.0/ 0000775 0001750 0001750 00000000000 13033303450 014301 5 ustar will will 0000000 0000000 Flask-Compress-1.4.0/MANIFEST.in 0000664 0001750 0001750 00000000136 13033272651 016047 0 ustar will will 0000000 0000000 include LICENSE.txt include README.md recursive-include tests * recursive-exclude tests *.pyc Flask-Compress-1.4.0/setup.cfg 0000664 0001750 0001750 00000000073 13033303450 016122 0 ustar will will 0000000 0000000 [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 Flask-Compress-1.4.0/setup.py 0000664 0001750 0001750 00000002412 13033301310 016003 0 ustar will will 0000000 0000000 import setuptools setuptools.setup( name='Flask-Compress', version='1.4.0', url='https://libwilliam.github.io/flask-compress/', license='MIT', author='William Fagan', author_email='libwilliam@gmail.com', description='Compress responses in your Flask app with gzip.', long_description='Full documentation can be found on the Flask-Compress "Home Page".', py_modules=['flask_compress'], zip_safe=False, include_package_data=True, platforms='any', install_requires=[ 'Flask' ], test_suite='tests', classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ] ) Flask-Compress-1.4.0/Flask_Compress.egg-info/ 0000775 0001750 0001750 00000000000 13033303450 020706 5 ustar will will 0000000 0000000 Flask-Compress-1.4.0/Flask_Compress.egg-info/SOURCES.txt 0000664 0001750 0001750 00000000626 13033303450 022576 0 ustar will will 0000000 0000000 LICENSE.txt MANIFEST.in README.md flask_compress.py setup.py Flask_Compress.egg-info/PKG-INFO Flask_Compress.egg-info/SOURCES.txt Flask_Compress.egg-info/dependency_links.txt Flask_Compress.egg-info/not-zip-safe Flask_Compress.egg-info/requires.txt Flask_Compress.egg-info/top_level.txt tests/__init__.py tests/test_flask_compress.py tests/static/1.png tests/templates/large.html tests/templates/small.html Flask-Compress-1.4.0/Flask_Compress.egg-info/top_level.txt 0000664 0001750 0001750 00000000017 13033303450 023436 0 ustar will will 0000000 0000000 flask_compress Flask-Compress-1.4.0/Flask_Compress.egg-info/dependency_links.txt 0000664 0001750 0001750 00000000001 13033303450 024754 0 ustar will will 0000000 0000000 Flask-Compress-1.4.0/Flask_Compress.egg-info/not-zip-safe 0000664 0001750 0001750 00000000001 13033274323 023142 0 ustar will will 0000000 0000000 Flask-Compress-1.4.0/Flask_Compress.egg-info/requires.txt 0000664 0001750 0001750 00000000006 13033303450 023302 0 ustar will will 0000000 0000000 Flask Flask-Compress-1.4.0/Flask_Compress.egg-info/PKG-INFO 0000664 0001750 0001750 00000002032 13033303450 022000 0 ustar will will 0000000 0000000 Metadata-Version: 1.1 Name: Flask-Compress Version: 1.4.0 Summary: Compress responses in your Flask app with gzip. Home-page: https://libwilliam.github.io/flask-compress/ Author: William Fagan Author-email: libwilliam@gmail.com License: MIT Description: Full documentation can be found on the Flask-Compress "Home Page". Platform: any Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content Classifier: Topic :: Software Development :: Libraries :: Python Modules Flask-Compress-1.4.0/tests/ 0000775 0001750 0001750 00000000000 13033303450 015443 5 ustar will will 0000000 0000000 Flask-Compress-1.4.0/tests/test_flask_compress.py 0000664 0001750 0001750 00000006536 13033272651 022111 0 ustar will will 0000000 0000000 import unittest import os from flask import Flask, render_template from flask_compress import Compress class DefaultsTest(unittest.TestCase): def setUp(self): self.app = Flask(__name__) self.app.testing = True Compress(self.app) def test_mimetypes_default(self): """ Tests COMPRESS_MIMETYPES default value is correctly set. """ defaults = ['text/html', 'text/css', 'text/xml', 'application/json', 'application/javascript'] self.assertEqual(self.app.config['COMPRESS_MIMETYPES'], defaults) def test_level_default(self): """ Tests COMPRESS_LEVEL default value is correctly set. """ self.assertEqual(self.app.config['COMPRESS_LEVEL'], 6) def test_min_size_default(self): """ Tests COMPRESS_MIN_SIZE default value is correctly set. """ self.assertEqual(self.app.config['COMPRESS_MIN_SIZE'], 500) class InitTests(unittest.TestCase): def setUp(self): self.app = Flask(__name__) self.app.testing = True def test_constructor_init(self): Compress(self.app) def test_delayed_init(self): compress = Compress() compress.init_app(self.app) class UrlTests(unittest.TestCase): def setUp(self): self.app = Flask(__name__) self.app.testing = True small_path = os.path.join(os.getcwd(), 'tests', 'templates', 'small.html') large_path = os.path.join(os.getcwd(), 'tests', 'templates', 'large.html') self.small_size = os.path.getsize(small_path) - 1 self.large_size = os.path.getsize(large_path) - 1 Compress(self.app) @self.app.route('/small/') def small(): return render_template('small.html') @self.app.route('/large/') def large(): return render_template('large.html') def client_get(self, ufs): client = self.app.test_client() response = client.get(ufs, headers=[('Accept-Encoding', 'gzip')]) self.assertEqual(response.status_code, 200) return response def test_compress_level(self): """ Tests COMPRESS_LEVEL correctly affects response data. """ self.app.config['COMPRESS_LEVEL'] = 1 response = self.client_get('/large/') response1_size = len(response.data) self.app.config['COMPRESS_LEVEL'] = 6 response = self.client_get('/large/') response6_size = len(response.data) self.assertNotEqual(response1_size, response6_size) def test_compress_min_size(self): """ Tests COMPRESS_MIN_SIZE correctly affects response data. """ response = self.client_get('/small/') self.assertEqual(self.small_size, len(response.data)) response = self.client_get('/large/') self.assertNotEqual(self.large_size, len(response.data)) def test_mimetype_mismatch(self): """ Tests if mimetype not in COMPRESS_MIMETYPES. """ response = self.client_get('/static/1.png') self.assertEqual(response.mimetype, 'image/png') def test_content_length_options(self): client = self.app.test_client() headers = [('Accept-Encoding', 'gzip')] response = client.options('/small/', headers=headers) self.assertEqual(response.status_code, 200) if __name__ == '__main__': unittest.main() Flask-Compress-1.4.0/tests/templates/ 0000775 0001750 0001750 00000000000 13033303450 017441 5 ustar will will 0000000 0000000 Flask-Compress-1.4.0/tests/templates/small.html 0000664 0001750 0001750 00000000055 13033272651 021447 0 ustar will will 0000000 0000000
Flask-Compress-1.4.0/tests/templates/large.html 0000664 0001750 0001750 00000000773 13033272651 021440 0 ustar will will 0000000 0000000Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Flask-Compress-1.4.0/tests/static/ 0000775 0001750 0001750 00000000000 13033303450 016732 5 ustar will will 0000000 0000000 Flask-Compress-1.4.0/tests/static/1.png 0000664 0001750 0001750 00000000357 13033272651 017615 0 ustar will will 0000000 0000000 PNG IHDR 7n$ gAMA a cHRM z&