Skip to content

Commit

Permalink
Fix #1866: Applications comparison is correct now (#1888)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov authored May 14, 2017
1 parent 127c451 commit a40fb59
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Changes

- Fix sub-application middlewares resolution order #1853

- Fix applications comparison #1866


2.0.7 (2017-04-12)
------------------
Expand Down
3 changes: 3 additions & 0 deletions aiohttp/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def __init__(self, *,

# MutableMapping API

def __eq__(self, other):
return self is other

def __getitem__(self, key):
return self._state[key]

Expand Down
8 changes: 8 additions & 0 deletions tests/test_web_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,11 @@ def test_secure_proxy_ssl_header_init(loop):
assert app._secure_proxy_ssl_header is hdr
app.make_handler(loop=loop)
assert app._secure_proxy_ssl_header is hdr


def test_equality():
app1 = web.Application()
app2 = web.Application()

assert app1 == app1
assert app1 != app2

0 comments on commit a40fb59

Please sign in to comment.