From 4c6a364551196833aef9d4ad74ec29510f5068ae Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sun, 6 Dec 2020 17:03:59 +0000 Subject: ridded of extranneous pkg directory --- pkg/datamaps/config_test.go | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 pkg/datamaps/config_test.go (limited to 'pkg/datamaps/config_test.go') diff --git a/pkg/datamaps/config_test.go b/pkg/datamaps/config_test.go deleted file mode 100644 index dadaf6d..0000000 --- a/pkg/datamaps/config_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package datamaps - -import ( - "os" - "path/filepath" - "testing" -) - -// mocking funcs in go https://stackoverflow.com/questions/19167970/mock-functions-in-go - -func mockConfigDir() (string, error) { - return "/tmp/CONFIG/datamaps/", nil -} - -func TestDBDetect(t *testing.T) { - - cPath := filepath.Join("/tmp", "CONFIG", "datamaps") - t.Logf("%s\n", cPath) - if err := os.MkdirAll(cPath, 0700); err != nil { - t.Fatalf("cannot create temporary directory - %v", err) - } - - if _, err := os.Create(filepath.Join("/tmp", "CONFIG", "datamaps", "datamaps.db")); err != nil { - t.Fatalf("cannot open '/tmp/CONFIG/datamaps/databamps.db': %v", err) - } - defer func() { - os.RemoveAll(filepath.Join("/tmp", "CONFIG")) - }() - - dbpc := NewDBPathChecker(mockConfigDir) - h := dbpc.Check() - if !h { - t.Error("the db file should be found but isn't") - } -} -- cgit v1.2.3