mirror of
https://github.com/project-zot/zot.git
synced 2026-06-15 20:07:55 +08:00
check: add unit tests to cover the new code, fix linter errors
This commit is contained in:
@@ -58,6 +58,16 @@ func TestAPIs(t *testing.T) {
|
||||
So(v, ShouldBeEmpty)
|
||||
})
|
||||
|
||||
Convey("Full blob upload", func() {
|
||||
body := []byte("this is a blob")
|
||||
buf := bytes.NewBuffer(body)
|
||||
d := godigest.FromBytes(body)
|
||||
u, n, err := il.FullBlobUpload("test", buf, d.String())
|
||||
So(err, ShouldBeNil)
|
||||
So(n, ShouldEqual, len(body))
|
||||
So(u, ShouldNotBeEmpty)
|
||||
})
|
||||
|
||||
Convey("New blob upload", func() {
|
||||
v, err := il.NewBlobUpload("test")
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
Reference in New Issue
Block a user