1
0

test: cover download debian cache

This commit is contained in:
dump_stack() 2023-05-13 12:36:19 +00:00
parent c8d171da98
commit 1818d38b03
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

22
cache/cache_test.go vendored
View File

@ -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)
}
}