test: cover download debian cache
This commit is contained in:
parent
c8d171da98
commit
1818d38b03
22
cache/cache_test.go
vendored
22
cache/cache_test.go
vendored
@ -10,7 +10,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestDownloadQemuImage(t *testing.T) {
|
func TestDownloadQemuImage(t *testing.T) {
|
||||||
|
|
||||||
tmp, err := ioutil.TempDir("", "out-of-tree_")
|
tmp, err := ioutil.TempDir("", "out-of-tree_")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -28,3 +27,24 @@ func TestDownloadQemuImage(t *testing.T) {
|
|||||||
t.Fatalf("%s does not exist", file)
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user