1
0

feat: implement part of metasnap api

This commit is contained in:
2023-05-15 07:29:40 +00:00
parent 21882ff461
commit 0f799b0d5a
2 changed files with 186 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package metasnap
import (
"testing"
"github.com/davecgh/go-spew/spew"
)
func TestGetPackageInfo(t *testing.T) {
// existing
infos, err := GetPackageInfo("linux-image-3.8-trunk-amd64",
"amd64", "3.8.2-1~experimental.1")
if err != nil {
t.Fatal(err)
}
t.Log(spew.Sdump(infos))
// non-existing
infos, err = GetPackageInfo("meh", "amd64", "meh")
if err == nil {
t.Fatalf("should not be ok, result: %s", spew.Sdump(infos))
}
if err != ErrNotFound {
t.Fatal("wrong error type")
}
}