magpie.mock.network

Module Contents

Classes

MockResponse

Mock object for an httpx.Response.

Functions

slugify

Return a slug for the given url that can be used as a filename.

http_get

Mocked network.http_get() function.

Data

API

magpie.mock.network.CACHE_DIR

None

class magpie.mock.network.MockResponse(text)[source]

Mock object for an httpx.Response.

It provides the text attribute and the json() method.

Initialization

json()[source]
magpie.mock.network.slugify(url: str)[source]

Return a slug for the given url that can be used as a filename.

magpie.mock.network.http_get(url: str, headers=None) httpx.Response[source]

Mocked network.http_get() function.