diff --git a/cache/cache_test.go b/cache/cache_test.go index 8c7b326..03665f3 100644 --- a/cache/cache_test.go +++ b/cache/cache_test.go @@ -10,7 +10,6 @@ import ( ) func TestDownloadQemuImage(t *testing.T) { - tmp, err := ioutil.TempDir("", "out-of-tree_") if err != nil { return @@ -28,3 +27,24 @@ func TestDownloadQemuImage(t *testing.T) { t.Fatalf("%s does not exist", file) } } + +func TestDownloadDebianCache(t *testing.T) { + tmp, err := ioutil.TempDir("", "out-of-tree_") + if err != nil { + return + } + defer os.RemoveAll(tmp) + + file := "debian.cache" + + cachePath := filepath.Join(tmp, file) + + err = DownloadDebianCache(cachePath) + if err != nil { + return + } + + if !fs.PathExists(filepath.Join(tmp, file)) { + t.Fatalf("%s does not exist", file) + } +}