diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-02-05 17:59:24 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-02-05 17:59:24 -0500 |
commit | d33541ff79e5d81959900b757e4857af14e4f4b2 (patch) | |
tree | 8674398bec363062569a53427fbf71ceffe2592f /dbstore/dbstore_test.go | |
parent | c89f404a0176415130089201a176a3ff76a02829 (diff) | |
download | cvez-d33541ff79e5d81959900b757e4857af14e4f4b2.tar.bz2 cvez-d33541ff79e5d81959900b757e4857af14e4f4b2.zip |
dbscore: add openFull and test
Diffstat (limited to 'dbstore/dbstore_test.go')
-rw-r--r-- | dbstore/dbstore_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/dbstore/dbstore_test.go b/dbstore/dbstore_test.go index fe653dc..1e03d72 100644 --- a/dbstore/dbstore_test.go +++ b/dbstore/dbstore_test.go @@ -198,19 +198,20 @@ func seedTestDb(ctx context.Context, db DbStore) error { // TODO: seed with other data } -func TestOpen(t *testing.T) { +func TestOpenFull(t *testing.T) { tests := []struct { name string + dbType string path string exp bool } { - { "pass", "./testdata/test-open.db", true }, - // { "fail", "file://invalid/foobar", false }, + { "pass", "sqlite3", "./testdata/test-open.db", true }, + { "fail", "invalid driver", "file://invalid/foobar", false }, } for _, test := range(tests) { t.Run(test.name, func(t *testing.T) { - got, err := Open(test.path) + got, err := openFull(test.dbType, test.path) if test.exp && err != nil { t.Error(err) } else if !test.exp && err == nil { |