Abstract classes for fixture.base.Fixture descendants that load / unload data
See Using LoadableFixture for examples.
Bases: fixture.base.Fixture
knows how to load data into something useful.
This is an abstract class and cannot be used directly. You can use a LoadableFixture that already knows how to load into a specific medium, such as SQLAlchemyFixture, or create your own to build your own to load DataSet objects into custom storage media.
Keyword Arguments:
load this dataset and all its dependent datasets.
level is essentially the order of processing (going from dataset to dependent datasets). Child datasets are always loaded before the parent. The level is important for visualizing the chain of dependencies : 0 is the bottom, and thus should be the first set of objects unloaded
Bases: fixture.loadable.loadable.LoadableFixture
An abstract fixture that can resolve DataSet objects from an env.
Keyword “env” should be a dict or a module if not None. According to the style rules, the env will be used to find objects by name.
Lookup a storage medium in the env and attach it to a DataSet.
A storage medium is looked up by name. If a specific name has not been declared in the DataSet then it will be guessed using the Style.guess_storable_name method.
Once a name is found (typically the name of a DataSet class, say, EmployeeData) then it is looked up in the env which is expected to be a dict or module like object.
The method first tries env.get('EmployeeData') then getattr(env, 'EmployeeData').
The return value is the storage medium (i.e. a data mapper for the Employees table)
Note that a style might translate a name to maintain a consistent naming scheme between DataSet classes and data mappers.
Bases: fixture.loadable.loadable.EnvLoadableFixture
An abstract fixture that can load a DataSet into a database like thing.
More specifically, one that forces its implementation to run atomically (within a begin / commit / rollback block).
must return a transaction object that implements commit() and rollback()
Note
transaction.begin() will not be called. If that is necessary then call begin before returning the object.
common interface for working with storable objects.
Given a DataRow, must save it somehow.
column_vals is an iterable of (column_name, column_value)
A chance to visit the LoadableFixture object.
By default it does nothing.