MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / write_bytes

Function write_bytes

tests/test_client_functional.py:1913–1939  ·  view source on GitHub ↗
(
        self: ClientRequest,
        writer: StreamWriter,
        conn: Connection,
        content_length: int | None = None,
    )

Source from the content-addressed store, hash-verified

1911 original_write_bytes = ClientRequest.write_bytes
1912
1913 async def write_bytes(
1914 self: ClientRequest,
1915 writer: StreamWriter,
1916 conn: Connection,
1917 content_length: int | None = None,
1918 ) -> None:
1919 nonlocal write_mock, writelines_mock
1920 original_write = writer._write
1921 original_writelines = writer._writelines
1922
1923 with (
1924 mock.patch.object(
1925 writer,
1926 "_write",
1927 autospec=True,
1928 spec_set=True,
1929 side_effect=original_write,
1930 ) as write_mock,
1931 mock.patch.object(
1932 writer,
1933 "_writelines",
1934 autospec=True,
1935 spec_set=True,
1936 side_effect=original_writelines,
1937 ) as writelines_mock,
1938 ):
1939 await original_write_bytes(self, writer, conn, content_length)
1940
1941 with mock.patch.object(ClientRequest, "write_bytes", write_bytes):
1942 app = web.Application()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected