intercom_test.utils module

class intercom_test.utils.FilteredDictView(d, *, key_filter=None, value_transform=None)[source]

Bases: object

dict-like access to a key-filtered and value-transformed dict

Only _viewing_ methods are supported, not modifications.

class Items(dview)[source]

Bases: object

class Keys(dview)[source]

Bases: object

class Values(dview)[source]

Bases: object

get(k, defval=None)[source]
items()[source]
keys()[source]
values()[source]
intercom_test.utils.def_enum(fn)[source]

Decorator allowing a function to DRYly define an enumeration

The decorated function should not require any arguments and should return an enumeration source, which will be passed to enum.Enum along with the name of the decorated function. The resulting enum.Enum-derived class will be returned.

The value returned by fn can be any kind of source accepted by the functional API of enum.Enum.

intercom_test.utils.open_temp_copy(path, binary=False, *, blocksize=None)[source]

Make a temporary copy of path and return the opened file

The returned file object will be opened with mode 'w+' or 'w+b' (depending on binary) and will be positioned at the beginning of the file contents. If specified, blocksize indicates the size of the buffer to use (in bytes) when making the copy.