3737from aiohttp .compression_utils import ZLibBackend
3838from aiohttp .connector import Connection
3939from aiohttp .http import HttpVersion10 , HttpVersion11 , StreamWriter
40+ from aiohttp .multipart import MultipartWriter
4041from aiohttp .typedefs import LooseCookies
4142
4243
@@ -757,7 +758,8 @@ async def test_formdata_boundary_from_headers(
757758 )
758759 async with await req .send (conn ):
759760 await asyncio .sleep (0 )
760- assert req .body ._boundary == boundary .encode () # type: ignore[union-attr]
761+ assert isinstance (req .body , MultipartWriter )
762+ assert req .body ._boundary == boundary .encode ()
761763
762764
763765async def test_post_data (loop : asyncio .AbstractEventLoop , conn : mock .Mock ) -> None :
@@ -767,7 +769,8 @@ async def test_post_data(loop: asyncio.AbstractEventLoop, conn: mock.Mock) -> No
767769 )
768770 resp = await req .send (conn )
769771 assert "/" == req .url .path
770- assert b"life=42" == req .body ._value # type: ignore[union-attr]
772+ assert isinstance (req .body , payload .Payload )
773+ assert b"life=42" == req .body ._value
771774 assert "application/x-www-form-urlencoded" == req .headers ["CONTENT-TYPE" ]
772775 await req .close ()
773776 resp .close ()
@@ -806,7 +809,8 @@ async def test_get_with_data(loop: asyncio.AbstractEventLoop) -> None:
806809 meth , URL ("http://python.org/" ), data = {"life" : "42" }, loop = loop
807810 )
808811 assert "/" == req .url .path
809- assert b"life=42" == req .body ._value # type: ignore[union-attr]
812+ assert isinstance (req .body , payload .Payload )
813+ assert b"life=42" == req .body ._value
810814 await req .close ()
811815
812816
0 commit comments