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-transformeddict
Only _viewing_ methods are supported, not modifications.
-
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 resultingenum.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.