Documentation ¶
Index ¶
- func DumpChangeLogState(c *gc.C, runner database.TxnRunner)
- type ControllerModelSuite
- type ControllerSuite
- func (s *ControllerSuite) ApplyDDLForRunner(c *gc.C, runner coredatabase.TxnRunner)
- func (s *ControllerSuite) ControllerTxnRunner() coredatabase.TxnRunner
- func (s *ControllerSuite) SeedControllerTable(c *gc.C, controllerModelUUID coremodel.UUID) (controllerUUID string)
- func (s *ControllerSuite) SeedControllerUUID(c *gc.C) (controllerUUID string)
- func (s *ControllerSuite) SetUpTest(c *gc.C)
- type ModelSuite
- type SchemaApplier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ControllerModelSuite ¶
type ControllerModelSuite struct {
ControllerSuite
}
ControllerModelSuite is used to provide a sql.DB reference for tests that can both be used for controller and model operations and their separate DB requirements.
func (*ControllerModelSuite) ModelTxnRunner ¶
func (s *ControllerModelSuite) ModelTxnRunner(c *gc.C, modelUUID string) coredatabase.TxnRunner
ModelTxnRunner returns a transaction runner on to the model database for the provided model uuid.
type ControllerSuite ¶
type ControllerSuite struct {
testing.DqliteSuite
}
ControllerSuite is used to provide a sql.DB reference to tests. It is pre-populated with the controller schema.
func (*ControllerSuite) ApplyDDLForRunner ¶
func (s *ControllerSuite) ApplyDDLForRunner(c *gc.C, runner coredatabase.TxnRunner)
ApplyDDLForRunner is responsible for applying the controller schema to the given database.
func (*ControllerSuite) ControllerTxnRunner ¶
func (s *ControllerSuite) ControllerTxnRunner() coredatabase.TxnRunner
ControllerTxnRunner returns a txn runner attached to the controller database.
func (*ControllerSuite) SeedControllerTable ¶
func (s *ControllerSuite) SeedControllerTable(c *gc.C, controllerModelUUID coremodel.UUID) (controllerUUID string)
SeedControllerTable sets the uuid in the controller table to the default testing value and the controller mode uuid to the supplied value. It does not add any other controller config.
func (*ControllerSuite) SeedControllerUUID ¶
func (s *ControllerSuite) SeedControllerUUID(c *gc.C) (controllerUUID string)
func (*ControllerSuite) SetUpTest ¶
func (s *ControllerSuite) SetUpTest(c *gc.C)
SetUpTest is responsible for setting up a testing database suite initialised with the controller schema.
type ModelSuite ¶
type ModelSuite struct { testing.DqliteSuite // contains filtered or unexported fields }
ModelSuite is used to provide an in-memory sql.DB reference to tests. It is pre-populated with the model schema.
func (*ModelSuite) ModelTxnRunner ¶
func (s *ModelSuite) ModelTxnRunner() coredatabase.TxnRunner
ModelTxnRunner returns a txn runner attached to the model database.
func (*ModelSuite) ModelUUID ¶
func (s *ModelSuite) ModelUUID() string
func (*ModelSuite) SetUpTest ¶
func (s *ModelSuite) SetUpTest(c *gc.C)
SetUpTest is responsible for setting up a testing database suite initialised with the model schema.
type SchemaApplier ¶
SchemaApplier is a helper that applies a schema to a database.