fix tests

This commit is contained in:
Tejal Desai
2020-03-24 10:50:59 -07:00
parent ffc372a63b
commit caaf6c8adf
3 changed files with 10 additions and 3 deletions
+6 -1
View File
@@ -371,10 +371,15 @@ func Test_filesToSave(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "")
original := config.RootDir
config.RootDir = tmpDir
if err != nil {
t.Errorf("error creating tmpdir: %s", err)
}
defer os.RemoveAll(tmpDir)
defer func () {
config.RootDir = original
os.RemoveAll(tmpDir)
}()
for _, f := range tt.files {
p := filepath.Join(tmpDir, f)