1
0
Fork 0

test: cover download debian cache

master
dump_stack() 2023-05-13 12:36:19 +00:00
parent c8d171da98
commit 1818d38b03
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
1 changed files with 21 additions and 1 deletions

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