Documentation
¶
Overview ¶
Package xtesting provides infrastructure for ZODB testing.
Index ¶
- func DrvTestEmptyDB(t *testing.T, zdrv zodb.IStorageDriver)
- func DrvTestLoad(t *testing.T, zdrv zodb.IStorageDriver, txnvOk []Txn, bugv ...string)
- func DrvTestWatch(t *testing.T, zurl string, zdrvOpen zodb.DriverOpener)
- func FatalIf(t *testing.T) func(error)
- func NeedPy(t testing.TB, modules ...string)
- func ZPyCommitRaw(zurl string, at zodb.Tid, objv ...ZRawObject) (_ zodb.Tid, err error)
- func ZPyRestore(zurl string, zin string) (tidv []zodb.Tid, err error)
- type Txn
- type ZRawObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrvTestEmptyDB ¶
func DrvTestEmptyDB(t *testing.T, zdrv zodb.IStorageDriver)
DrvTestEmptyDB verifies that zdrv works correctly on empty database.
func DrvTestLoad ¶
DrvTestLoad verifies that zdrv implements Load correctly.
txnvOk is what data to expect to be in the database.
func DrvTestWatch ¶
func DrvTestWatch(t *testing.T, zurl string, zdrvOpen zodb.DriverOpener)
DrvTestWatch verifies that storage driver watcher can observe commits done from outside.
func NeedPy ¶
NeedPy skips current test if python and specified modules are not available.
For example
xtesting.NeedPy(t)
would check for python presence, and
xtesting.NeedPy(t, "ZODB", "golang.strconv")
would check if all python and ZODB and golang.strconv python modules are available.
func ZPyCommitRaw ¶
ZPyCommitRaw commits new transaction into database @ zurl with raw data specified by objv.
Nil data means "delete object". The commit is performed via zodbtools/py.
Types ¶
type Txn ¶
Txn represents one transaction.
func LoadDBHistory ¶
LoadDBHistory loads whole content of a ZODB database.
it returns full history of all transactions with committed data.
type ZRawObject ¶
ZRawObject represents raw ZODB object state.