noisify.attribute_readers package¶
noisify.attribute_readers.attribute_readers module¶
Attribute Readers allow faults to be directed to specific attributes of an input object. These do not need to be literal attributes, they can be values in a dictionary or columns in a database for example, as long as they can be accessed via a key.
-
class
noisify.attribute_readers.attribute_readers.
AttributeReader
(attribute_identifier, faults=None)[source]¶ Bases:
noisify.helpers.fallible.Fallible
The AttributeReader interface describes a mechanism to read and write values from an object
-
get_value
(truth_object)[source]¶ (Part of the interface) Must return the ground truth for the given attribute of the original object
-
-
class
noisify.attribute_readers.attribute_readers.
DictValue
(attribute_identifier, faults=None)[source]¶ Bases:
noisify.attribute_readers.attribute_readers.AttributeReader
Provides support for dictionary value lookups as attributes.
-
class
noisify.attribute_readers.attribute_readers.
ObjectAttribute
(attribute_identifier, faults=None)[source]¶ Bases:
noisify.attribute_readers.attribute_readers.AttributeReader
Provides support for literal object attributes as attributes.
noisify.attribute_readers.inspection_strategies module¶
Inspection strategies are used by reporters to create attribute_readers for given objects when none are specified.
-
noisify.attribute_readers.inspection_strategies.
dictionary_lookup
(unknown_dictionary, attribute_faults=None)[source]¶ Generates attribute_readers for each key/value pair of a given dictionary, enables reporters to map faults across dictionaries without further specification.
-
noisify.attribute_readers.inspection_strategies.
object_attributes_lookup
(unknown_object, attribute_faults=None)[source]¶ Generates attribute_readers for each attribute of a given object, enables reporters to map faults across objects without further specification. Ignores methods and private attributes marked with ‘_’.