userver: testsuite.matching.IsInstance Class Reference
Loading...
Searching...
No Matches
testsuite.matching.IsInstance Class Reference

Detailed Description

Match value by its type.

Use this class when you only need to check value type.

.. code-block:: python

assert response.json() == {

order_id must be a string

'order_id': matching.IsInstance(str),

int or float is acceptable here

'weight': matching.IsInstance([int, float]), ... }

Definition at line 105 of file matching.py.

Public Member Functions

 __init__ (self, types)
 __repr__ (self)
 __eq__ (self, other)

Protected Attributes

 _types = types

Constructor & Destructor Documentation

◆ __init__()

testsuite.matching.IsInstance.__init__ ( self,
types )

Definition at line 121 of file matching.py.

Member Function Documentation

◆ __eq__()

testsuite.matching.IsInstance.__eq__ ( self,
other )

Definition at line 131 of file matching.py.

◆ __repr__()

testsuite.matching.IsInstance.__repr__ ( self)

Definition at line 124 of file matching.py.

Member Data Documentation

◆ _types

testsuite.matching.IsInstance._types = types
protected

Definition at line 122 of file matching.py.


The documentation for this class was generated from the following file: