37
37
from aiohttp .compression_utils import ZLibBackend
38
38
from aiohttp .connector import Connection
39
39
from aiohttp .http import HttpVersion10 , HttpVersion11 , StreamWriter
40
+ from aiohttp .multipart import MultipartWriter
40
41
from aiohttp .typedefs import LooseCookies
41
42
42
43
@@ -757,7 +758,8 @@ async def test_formdata_boundary_from_headers(
757
758
)
758
759
async with await req .send (conn ):
759
760
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 ()
761
763
762
764
763
765
async 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
767
769
)
768
770
resp = await req .send (conn )
769
771
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
771
774
assert "application/x-www-form-urlencoded" == req .headers ["CONTENT-TYPE" ]
772
775
await req .close ()
773
776
resp .close ()
@@ -806,7 +809,8 @@ async def test_get_with_data(loop: asyncio.AbstractEventLoop) -> None:
806
809
meth , URL ("http://python.org/" ), data = {"life" : "42" }, loop = loop
807
810
)
808
811
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
810
814
await req .close ()
811
815
812
816
0 commit comments