Added a test for AllocDir.LogDir

This commit is contained in:
Diptanu Choudhury 2016-02-25 09:08:51 -08:00
parent 7891737fa8
commit 03c32d9bad
1 changed files with 16 additions and 0 deletions

View File

@ -70,6 +70,22 @@ func TestAllocDir_BuildAlloc(t *testing.T) {
}
}
func TestAllocDir_LogDir(t *testing.T) {
tmp, err := ioutil.TempDir("", "AllocDir")
if err != nil {
t.Fatalf("Couldn't create temp dir: %v", err)
}
defer os.RemoveAll(tmp)
d := NewAllocDir(tmp)
defer d.Destroy()
expected := filepath.Join(d.AllocDir, SharedAllocName, LogDirName)
if d.LogDir() != expected {
t.Fatalf("expected: %v, got: %v", expected, d.LogDir())
}
}
func TestAllocDir_EmbedNonExistent(t *testing.T) {
tmp, err := ioutil.TempDir("", "AllocDir")
if err != nil {