Skip to content

Commit

Permalink
Merge pull request #192 from patrick-zippenfenig/CachedResponse-closed
Browse files Browse the repository at this point in the history
Add attribute `closed` to `CachedResponse`
  • Loading branch information
JWCook committed Oct 6, 2023
2 parents c7ec56f + 87e35f0 commit d72bafa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aiohttp_client_cache/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ def connection(self):
async def __aenter__(self) -> 'CachedResponse':
return self

@property
def closed(self) -> bool:
return True

def close(self):
pass

Expand Down
1 change: 1 addition & 0 deletions test/unit/test_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ async def test_no_ops(aiohttp_client):
await response.start()
response.release()
response.close()
assert response.closed is True
await response.wait_for_close()
await response.terminate()
assert response.connection is None
Expand Down

0 comments on commit d72bafa

Please sign in to comment.