mirror of
https://github.com/project-zot/zot.git
synced 2025-01-06 22:40:28 -05:00
af819e7b76
* refactor(repodb): moving common utilities under pkg/meta Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com> * refactor(repodb): moved update, version components under pkg/meta - updated wrapper initialization to recieve a log object in constructor Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com> * refactor(repodb): moved repodb initialization from controller to pkg/meta/repodb Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com> --------- Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
24 lines
509 B
Go
24 lines
509 B
Go
package common_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
|
|
"zotregistry.io/zot/pkg/meta/common"
|
|
)
|
|
|
|
func TestUtils(t *testing.T) {
|
|
Convey("GetReferredSubject", t, func() {
|
|
_, err := common.GetReferredSubject([]byte("bad json"))
|
|
So(err, ShouldNotBeNil)
|
|
})
|
|
|
|
Convey("MatchesArtifactTypes", t, func() {
|
|
res := common.MatchesArtifactTypes("", nil)
|
|
So(res, ShouldBeTrue)
|
|
|
|
res = common.MatchesArtifactTypes("type", []string{"someOtherType"})
|
|
So(res, ShouldBeFalse)
|
|
})
|
|
}
|