mirror of
https://github.com/dolthub/dolt.git
synced 2026-03-20 09:11:16 -05:00
Fixed the broken tests caused by Brian's panic fix
This commit is contained in:
@@ -45,7 +45,7 @@ type DoltDB struct {
|
||||
|
||||
// LoadDoltDB will acquire a reference to the underlying noms db. If the Location is InMemDoltDB then a reference
|
||||
// to a newly created in memory database will be used. If the location is LocalDirDoltDB, the directory must exist or
|
||||
// this function panics.
|
||||
// this returns nil.
|
||||
func LoadDoltDB(loc Location) *DoltDB {
|
||||
if loc == LocalDirDoltDB {
|
||||
exists, isDir := filesys.LocalFS.Exists(DoltDataDir)
|
||||
|
||||
@@ -65,9 +65,7 @@ func TestLoadNonExistentLocalFSRepo(t *testing.T) {
|
||||
panic("Couldn't change the working directory to the test directory.")
|
||||
}
|
||||
|
||||
assert.Panics(t, func() {
|
||||
LoadDoltDB(LocalDirDoltDB)
|
||||
}, "Should have panicked when loading a non-existent data dir")
|
||||
assert.Nil(t, LoadDoltDB(LocalDirDoltDB), "Should return nil when loading a non-existent data dir")
|
||||
}
|
||||
|
||||
func TestLoadBadLocalFSRepo(t *testing.T) {
|
||||
@@ -80,9 +78,7 @@ func TestLoadBadLocalFSRepo(t *testing.T) {
|
||||
contents := []byte("not a directory")
|
||||
ioutil.WriteFile(filepath.Join(testDir, DoltDataDir), contents, 0644)
|
||||
|
||||
assert.Panics(t, func() {
|
||||
LoadDoltDB(LocalDirDoltDB)
|
||||
}, "Should have panicked when loading a non-directory data dir file")
|
||||
assert.Nil(t, LoadDoltDB(LocalDirDoltDB), "Should return nil when loading a non-directory data dir file")
|
||||
}
|
||||
|
||||
func TestLDNoms(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user