forked from genuinetools/reg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest_test.go
44 lines (37 loc) · 1014 Bytes
/
manifest_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"fmt"
"strings"
"testing"
)
func TestManifestV2(t *testing.T) {
out, err := run("manifest", fmt.Sprintf("%s/busybox", domain))
if err != nil {
t.Fatalf("output: %s, error: %v", out, err)
}
expected := `"schemaVersion": 2,`
if !strings.Contains(out, expected) {
t.Fatalf("expected: %s\ngot: %s", expected, out)
}
}
func TestManifestV1(t *testing.T) {
out, err := run("manifest", "--v1", fmt.Sprintf("%s/busybox", domain))
if err != nil {
t.Fatalf("output: %s, error: %v", out, err)
}
expected := `"schemaVersion": 1,`
if !strings.Contains(out, expected) {
t.Fatalf("expected: %s\ngot: %s", expected, out)
}
}
func TestManifestWithHubDomain(t *testing.T) {
// Regression test for https://github.com/genuinetools/reg/issues/164
out, err := run("manifest", "busybox")
if err != nil {
t.Fatalf("output: %s, error: %v", out, err)
}
expected := `"schemaVersion": 2,`
if !strings.Contains(out, expected) {
t.Fatalf("expected: %s\ngot: %s", expected, out)
}
}