tests: unify testdata directory

This commit is contained in:
George Tankersley
2018-12-14 19:17:27 -05:00
parent 313adc8432
commit abca4335ec
14 changed files with 15 additions and 57 deletions

View File

@@ -17,16 +17,17 @@ import (
"github.com/gtank/ctxd/rpc"
)
func TestSqliteStorage(t *testing.T) {
type compactTest struct {
BlockHeight int `json:"block"`
BlockHash string `json:"hash"`
Full string `json:"full"`
Compact string `json:"compact"`
}
var compactTests []compactTest
type compactTest struct {
BlockHeight int `json:"block"`
BlockHash string `json:"hash"`
Full string `json:"full"`
Compact string `json:"compact"`
}
blockJSON, err := ioutil.ReadFile("testdata/compact_blocks.json")
var compactTests []compactTest
func TestSqliteStorage(t *testing.T) {
blockJSON, err := ioutil.ReadFile("../testdata/compact_blocks.json")
if err != nil {
t.Fatal(err)
}
@@ -35,11 +36,6 @@ func TestSqliteStorage(t *testing.T) {
if err != nil {
t.Fatal(err)
}
conn, err := sql.Open("sqlite3", ":memory:")
if err != nil {
t.Fatal(err)
}
defer conn.Close()
err = CreateTables(conn)

File diff suppressed because one or more lines are too long