MCPcopy
hub / github.com/redspread/spread / TestParseTag

Function TestParseTag

pkg/image/image_test.go:39–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestParseTag(t *testing.T) {
40 name := "debian"
41 tag := "jessie"
42
43 // "debian:jessie"
44 imageStr := name + ":" + tag
45
46 image, err := FromString(imageStr)
47 assert.NoError(t, err, "valid image name")
48
49 // Name
50 assert.Equal(t, name, image.Name())
51
52 // KubeImage
53 assert.Equal(t, imageStr, image.KubeImage())
54
55 // PushOptions
56 out := testSampleWriter(3)
57 json := true
58 expected := docker.PushImageOptions{
59 Name: "library/" + name,
60 Tag: tag,
61 Registry: DefaultDockerRegistry,
62 OutputStream: out,
63 RawJSONStream: json,
64 }
65 assert.Equal(t, expected, image.PushOptions(out, json))
66}
67
68func TestParseUserName(t *testing.T) {
69 user := "base"

Callers

nothing calls this directly

Calls 6

FromStringFunction · 0.85
testSampleWriterTypeAlias · 0.85
NameMethod · 0.80
KubeImageMethod · 0.80
PushOptionsMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected