File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ Restored the ``force_close `` method to the ``ResponseHandler `` -- by :user: `bdraco `.
Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ def should_close(self) -> bool:
64
64
or self ._tail
65
65
)
66
66
67
+ def force_close (self ) -> None :
68
+ self ._should_close = True
69
+
67
70
def close (self ) -> None :
68
71
transport = self .transport
69
72
if transport is not None :
Original file line number Diff line number Diff line change 12
12
from aiohttp .http_parser import RawResponseMessage
13
13
14
14
15
+ async def test_force_close (loop : asyncio .AbstractEventLoop ) -> None :
16
+ """Ensure that the force_close method sets the should_close attribute to True.
17
+
18
+ This is used externally in aiodocker
19
+ https://github.com/aio-libs/aiodocker/issues/920
20
+ """
21
+ proto = ResponseHandler (loop = loop )
22
+ proto .force_close ()
23
+ assert proto .should_close
24
+
25
+
15
26
async def test_oserror (loop : asyncio .AbstractEventLoop ) -> None :
16
27
proto = ResponseHandler (loop = loop )
17
28
transport = mock .Mock ()
You can’t perform that action at this time.
0 commit comments