# aioresponses package

## Submodules

## aioresponses.core module

class aioresponses.core.CallbackResult(method: str = 'GET', status: int = 200, body: Union[str, bytes] = '', content_type: str = 'application/json', payload: Optional[Dict] = None, headers: Optional[Dict] = None, response_class: Optional[aiohttp.client_reqrep.ClientResponse] = None, reason: Optional[str] = None)

  Bases: `object`

class aioresponses.core.RequestCall(args, kwargs)

  Bases: `tuple`

  args

    Alias for field number 0

  kwargs

    Alias for field number 1

class aioresponses.core.RequestMatch(url: Union[yarl.URL, str, re.Pattern], method: str = 'GET', status: int = 200, body: Union[str, bytes] = '', payload: Optional[Dict] = None, exception: Optional[Exception] = None, headers: Optional[Dict] = None, content_type: str = 'application/json', response_class: Optional[aiohttp.client_reqrep.ClientResponse] = None, timeout: bool = False, repeat: bool = False, reason: Optional[str] = None, callback: Optional[Callable] = None)

  Bases: `object`

  async build_response(url: yarl.URL, **kwargs) → Union[aiohttp.client_reqrep.ClientResponse, Exception]
  match(method: str, url: yarl.URL) → bool
  match_regexp(url: yarl.URL) → bool
  match_str(url: yarl.URL) → bool
  url_or_pattern: Union[yarl.URL, re.Pattern] = None

class aioresponses.core.aioresponses(**kwargs)

  Bases: `object`

  Mock aiohttp requests made by ClientSession.

  add(url: Union[yarl.URL, str, re.Pattern], method: str = 'GET', status: int = 200, body: Union[str, bytes] = '', exception: Optional[Exception] = None, content_type: str = 'application/json', payload: Optional[Dict] = None, headers: Optional[Dict] = None, response_class: Optional[aiohttp.client_reqrep.ClientResponse] = None, repeat: bool = False, timeout: bool = False, reason: Optional[str] = None, callback: Optional[Callable] = None) → None
  clear()
  delete(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  get(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  head(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  static is_exception(resp_or_exc: Union[aiohttp.client_reqrep.ClientResponse, Exception]) → bool
  async match(method: str, url: yarl.URL, allow_redirects: bool = True, **kwargs: Dict) → Optional[aiohttp.client_reqrep.ClientResponse]
  options(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  patch(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  post(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  put(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  requests: Dict = None
  start()
  stop() → None

## Module contents

class aioresponses.CallbackResult(method: str = 'GET', status: int = 200, body: Union[str, bytes] = '', content_type: str = 'application/json', payload: Optional[Dict] = None, headers: Optional[Dict] = None, response_class: Optional[aiohttp.client_reqrep.ClientResponse] = None, reason: Optional[str] = None)

  Bases: `object`

class aioresponses.aioresponses(**kwargs)

  Bases: `object`

  Mock aiohttp requests made by ClientSession.

  add(url: Union[yarl.URL, str, re.Pattern], method: str = 'GET', status: int = 200, body: Union[str, bytes] = '', exception: Optional[Exception] = None, content_type: str = 'application/json', payload: Optional[Dict] = None, headers: Optional[Dict] = None, response_class: Optional[aiohttp.client_reqrep.ClientResponse] = None, repeat: bool = False, timeout: bool = False, reason: Optional[str] = None, callback: Optional[Callable] = None) → None
  clear()
  delete(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  get(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  head(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  static is_exception(resp_or_exc: Union[aiohttp.client_reqrep.ClientResponse, Exception]) → bool
  async match(method: str, url: yarl.URL, allow_redirects: bool = True, **kwargs: Dict) → Optional[aiohttp.client_reqrep.ClientResponse]
  options(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  patch(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  post(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  put(url: Union[yarl.URL, str, re.Pattern], **kwargs)
  requests: Dict = None
  start()
  stop() → None