tree-wide: format the code
$ go fmt ./... Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
b60f580d92
commit
da887a43fb
5 changed files with 21 additions and 11 deletions
|
|
@ -20,9 +20,9 @@ var repo = rpmmd.RepoConfig{
|
|||
BaseURL: "http://example.com/test/os",
|
||||
}
|
||||
|
||||
var packages = rpmmd.PackageList {
|
||||
{ Name: "package1" },
|
||||
{ Name: "package2" },
|
||||
var packages = rpmmd.PackageList{
|
||||
{Name: "package1"},
|
||||
{Name: "package2"},
|
||||
}
|
||||
|
||||
func testRoute(t *testing.T, api *weldr.API, method, path, body string, expectedStatus int, expectedJSON string) {
|
||||
|
|
@ -110,7 +110,7 @@ func TestBasic(t *testing.T) {
|
|||
{"/api/v0/blueprints/info/example", http.StatusOK, `*`},
|
||||
}
|
||||
|
||||
for _, c:= range cases {
|
||||
for _, c := range cases {
|
||||
api := weldr.New(repo, packages, nil)
|
||||
testRoute(t, api, "GET", c.Path, ``, c.ExpectedStatus, c.ExpectedJSON)
|
||||
}
|
||||
|
|
@ -124,7 +124,7 @@ func TestBlueprints(t *testing.T) {
|
|||
http.StatusOK, `{"status":true}`)
|
||||
|
||||
testRoute(t, api, "GET", "/api/v0/blueprints/info/test", ``,
|
||||
http.StatusOK, `{"blueprints":[{"name":"test","description":"Test","modules":[],"packages":[{"name":"httpd","version":"2.4.*"}],"version":"0"}],
|
||||
http.StatusOK, `{"blueprints":[{"name":"test","description":"Test","modules":[],"packages":[{"name":"httpd","version":"2.4.*"}],"version":"0"}],
|
||||
"changes":[{"name":"test","changed":false}], "errors":[]}`)
|
||||
|
||||
testRoute(t, api, "POST", "/api/v0/blueprints/workspace",
|
||||
|
|
@ -132,6 +132,6 @@ func TestBlueprints(t *testing.T) {
|
|||
http.StatusOK, `{"status":true}`)
|
||||
|
||||
testRoute(t, api, "GET", "/api/v0/blueprints/info/test", ``,
|
||||
http.StatusOK, `{"blueprints":[{"name":"test","description":"Test","modules":[],"packages":[{"name":"systemd","version":"123"}],"version":"0"}],
|
||||
http.StatusOK, `{"blueprints":[{"name":"test","description":"Test","modules":[],"packages":[{"name":"systemd","version":"123"}],"version":"0"}],
|
||||
"changes":[{"name":"test","changed":true}], "errors":[]}`)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue