예제 #1
0
func makeFakeTile(t *testing.T, filename string, tile *tiling.Tile) {
	f, err := os.Create(filename)
	assert.Nil(t, err, fmt.Sprintf("File creation failed before test start: %s", err))
	defer testutils.AssertCloses(t, f)
	enc := gob.NewEncoder(f)
	assert.Nil(t, enc.Encode(tile), fmt.Sprintf("Tile globbed failed before test start: %s", err))
	assert.Nil(t, f.Sync())
}
func TestSQLIgnoreStore(t *testing.T) {
	// Set up the database. This also locks the db until this test is finished
	// causing similar tests to wait.
	migrationSteps := db.MigrationSteps()
	mysqlDB := testutil.SetupMySQLTestDatabase(t, migrationSteps)
	defer mysqlDB.Close(t)

	vdb, err := testutil.LocalTestDatabaseConfig(migrationSteps).NewVersionedDB()
	assert.Nil(t, err)
	defer testutils.AssertCloses(t, vdb)

	store := NewSQLIgnoreStore(vdb)
	testIgnoreStore(t, store)
}