Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split wrappers #1456

Merged
merged 31 commits into from Feb 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f1d5d60
Add separate file for 'accept.py'.
davidism Feb 12, 2019
f46a2ea
Add separate file for 'auth.py'.
davidism Feb 12, 2019
966070f
Add separate file for 'base_request.py'.
davidism Feb 12, 2019
e14cce4
Add separate file for 'base_response.py'.
davidism Feb 12, 2019
deefbc6
Change content in separated file 'accept.py'.
davidism Feb 12, 2019
4304ce0
Change content in separated file 'auth.py'.
davidism Feb 12, 2019
cb12c2b
Change content in separated file 'base_request.py'.
davidism Feb 12, 2019
7c2d678
Add separate file for 'common_descriptors.py'.
davidism Feb 12, 2019
d0a760b
Change content in separated file 'base_response.py'.
davidism Feb 12, 2019
d6894ea
Merge branch 'split-file___init__.py_accept.py' into split-file___ini…
davidism Feb 12, 2019
f2a8093
Merge branch 'split-file___init__.py_auth.py' into split-file___init_…
davidism Feb 12, 2019
5c6eba9
Merge branch 'split-file___init__.py_base_request.py' into split-file…
davidism Feb 12, 2019
da115e7
Add separate file for 'etag.py'.
davidism Feb 12, 2019
7eda814
Change content in separated file 'common_descriptors.py'.
davidism Feb 12, 2019
2ec4b98
Merge branch 'split-file___init__.py_base_response.py' into split-fil…
davidism Feb 12, 2019
3b10a77
Add separate file for 'request.py'.
davidism Feb 12, 2019
33e276b
Add separate file for 'response.py'.
davidism Feb 12, 2019
f74cecf
Add separate file for 'user_agent.py'.
davidism Feb 12, 2019
41653f3
Change content in separated file 'etag.py'.
davidism Feb 12, 2019
3e457b5
Merge branch 'split-file___init__.py_common_descriptors.py' into spli…
davidism Feb 12, 2019
41b9828
Change content in separated file 'request.py'.
davidism Feb 12, 2019
99ebb45
Change content in separated file 'response.py'.
davidism Feb 12, 2019
fe9b4a4
Change content in separated file 'user_agent.py'.
davidism Feb 12, 2019
e69275e
Merge branch 'split-file___init__.py_etag.py' into split-file___init_…
davidism Feb 12, 2019
0e30a72
Merge branch 'split-file___init__.py_request.py' into split-file___in…
davidism Feb 12, 2019
249afb0
Merge branch 'split-file___init__.py_response.py' into split-file___i…
davidism Feb 12, 2019
8aff32f
Merge branch 'split-file___init__.py_user_agent.py' into split-file__…
davidism Feb 12, 2019
48f280c
Remove content that has been split of from '__init__.py'.
davidism Feb 12, 2019
f0b603d
Merge branch 'split-file___init__.py' into split-wrappers
davidism Feb 12, 2019
a413d66
fix tests after wrappers split
davidism Feb 11, 2019
102b8dc
add changelog
davidism Feb 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.rst
Expand Up @@ -232,6 +232,11 @@ Unreleased
:class:`werkzeug.middleware.http_proxy.ProxyMiddleware`.
- ``werkzeug.wsgi.SharedDataMiddleware`` has moved to
:class:`werkzeug.middleware.shared_data.SharedDataMiddleware`.
- The ``werkzeug.wrappers`` module has been converted to a package,
and its various classes have been organized into separate modules.
The documented classes, understood to be the public API, are still
importable from ``werkzeug.wrappers``, or may be imported from their
specific modules. (`#1456`_)

.. _#4: https://github.com/pallets/werkzeug/issues/4
.. _`#209`: https://github.com/pallets/werkzeug/pull/209
Expand Down Expand Up @@ -303,6 +308,7 @@ Unreleased
.. _#1439: https://github.com/pallets/werkzeug/pull/1439
.. _#1445: https://github.com/pallets/werkzeug/pull/1445
.. _#1452: https://github.com/pallets/werkzeug/pull/1452
.. _#1456: https://github.com/pallets/werkzeug/pull/1456


Version 0.14.1
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Expand Up @@ -31,3 +31,5 @@ source =
ignore = E126,E241,E272,E305,E402,E731,W503
exclude=.tox,examples,docs
max-line-length=100
per-file-ignores =
werkzeug/wrappers/__init__.py: F401
13 changes: 8 additions & 5 deletions tests/test_wrappers.py
Expand Up @@ -24,11 +24,14 @@
from werkzeug import wrappers
from werkzeug.exceptions import SecurityError, RequestedRangeNotSatisfiable, \
BadRequest
from werkzeug.http import generate_etag
from werkzeug.wrappers.json import JSONMixin
from werkzeug.wsgi import LimitedStream, wrap_file
from werkzeug.datastructures import MultiDict, ImmutableOrderedMultiDict, \
ImmutableList, ImmutableTypeConversionDict, CharsetAccept, \
MIMEAccept, LanguageAccept, Accept, CombinedMultiDict
from werkzeug.datastructures import (
MultiDict, ImmutableOrderedMultiDict,
ImmutableList, ImmutableTypeConversionDict, CharsetAccept,
MIMEAccept, LanguageAccept, Accept, CombinedMultiDict, Headers,
)
from werkzeug.test import Client, create_environ, run_wsgi_app
from werkzeug._compat import implements_iterator, text_type

Expand Down Expand Up @@ -713,7 +716,7 @@ class WithoutFreeze(wrappers.BaseResponse, wrappers.ETagResponseMixin):
response = WithFreeze('Hello World')
response.freeze()
strict_eq(response.get_etag(),
(text_type(wrappers.generate_etag(b'Hello World')), False))
(text_type(generate_etag(b'Hello World')), False))
response = WithoutFreeze('Hello World')
response.freeze()
assert response.get_etag() == (None, None)
Expand Down Expand Up @@ -1080,7 +1083,7 @@ class MyRequest(wrappers.Request):


def test_response_headers_passthrough():
headers = wrappers.Headers()
headers = Headers()
resp = wrappers.Response(headers=headers)
assert resp.headers is headers

Expand Down