Bases: object
Holder object for test data. Any functions passed to the init method will be called with the TestData object as their only argument. They can then load data onto the object as desired.
The idea is to use the instantiated object like this:
>>> import glance_data
>>> TEST = TestData(glance_data.data)
>>> TEST.images.list()
[<Image: visible_image>, <Image: invisible_image>]
>>> TEST.images.first()
<Image: visible_image>
You can load as little or as much data as you like as long as the loaders don’t conflict with each other.
See the TestDataContainer class for a list of available methods.
Bases: object
A container for test data objects.
The behavior of this class is meant to mimic a “manager” class, which has convenient shortcuts for common actions like “list”, “filter”, “get”, and “add”.
Add a new object to this container.
Generally this method should only be used during data loading, since adding data during a test can affect the results of other tests.
Returns objects in this container whose attributes match the given keyword arguments.
Returns the first object from this container.
Returns the single object in this container whose attributes match the given keyword arguments. An error will be raised if the arguments provided don’t return exactly one match.
Returns a list of all objects in this container.