Commit graph

7 commits

Author SHA1 Message Date
Dave Collins 396d1b056d Add interface test for FetchBlockBySha.
This commit adds an interface test for FetchBlockBySha to ensure it
returns the same MsgBlock and raw bytes that were inserted.
2013-10-14 12:26:38 -05:00
Dave Collins 2d84623493 Move non-interface specific tests into db_test.go.
The idea here is that interface_test.go will be directly usable in each
implementation to increase test coverage there as well, but also works at
the  top-most level to test arbitrary backends.
2013-10-14 12:26:37 -05:00
Dave Collins ff429203c4 Start interface tests that require state. 2013-10-14 12:26:37 -05:00
Dave Collins 82d1898b12 Add interface test for unsupported dbtype failures.
This commit adds an interface test to ensure that the interface returns
the expected error when trying to open or create an unsupported database
type.
2013-10-14 12:26:36 -05:00
Dave Collins d4c1214496 Add interface test for create and open failures.
This commit adds an interface test to ensure that failures which occur
while creating or opening a database are properly handled.
2013-10-14 12:26:35 -05:00
Dave Collins 53ea2cf0ba Add interface test for adding a duplicate driver.
This commit adds an interface test to ensure that attempting to add a
duplicate driver for a given database type does not overwrite an existing
one.
2013-10-14 12:26:34 -05:00
Dave Collins a27c37793b Add basic infrastructure for interface tests.
This is simply at start at providing generic interface tests.  The only
thing is tests so far is the empty database conditions on NewestSha, but
it adds infrastructure for creating and opening databases with special
type handling based on the database and necessary logic to teardown so
multiple backends can be tested simultaneously.

This and the next series of commits all discussed with drahn@.
2013-10-14 12:26:12 -05:00