mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-21 13:23:09 +01:00
Split tests
This commit is contained in:
@@ -29,24 +29,3 @@ func TestMain(m *testing.M) {
|
||||
func TestNew(t *testing.T) {
|
||||
assert.NotNil(t, rc)
|
||||
}
|
||||
|
||||
func TestTags(t *testing.T) {
|
||||
assert.NotNil(t, rc)
|
||||
|
||||
image, err := registry.ParseImage(registry.ParseImageOptions{
|
||||
Name: "crazymax/diun:3.0.0",
|
||||
})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
tags, err := rc.Tags(registry.TagsOptions{
|
||||
Image: image,
|
||||
})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
assert.True(t, tags.Total > 0)
|
||||
assert.True(t, len(tags.List) > 0)
|
||||
}
|
||||
|
||||
29
pkg/registry/tags_test.go
Normal file
29
pkg/registry/tags_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package registry_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/crazy-max/diun/v4/pkg/registry"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestTags(t *testing.T) {
|
||||
assert.NotNil(t, rc)
|
||||
|
||||
image, err := registry.ParseImage(registry.ParseImageOptions{
|
||||
Name: "crazymax/diun:3.0.0",
|
||||
})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
tags, err := rc.Tags(registry.TagsOptions{
|
||||
Image: image,
|
||||
})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
assert.True(t, tags.Total > 0)
|
||||
assert.True(t, len(tags.List) > 0)
|
||||
}
|
||||
Reference in New Issue
Block a user