tests: delete blueprints after tests

At the end of each set of tests the blueprint created is deleted.
This tests the delete route as well as removing blueprints
created while testing external apis such as lorax.
This commit is contained in:
Jacob Kozol 2019-10-09 15:43:30 +02:00 committed by Tom Gundersen
parent 6e790bc62d
commit d5830a4794

View file

@ -179,6 +179,9 @@ func TestBlueprints(t *testing.T) {
testRoute(t, api, "GET", "/api/v0/blueprints/diff/test/NEWEST/WORKSPACE", ``,
http.StatusOK, `{"diff":[{"new":{"Package":{"name":"systemd","version":"123"}},"old":null},{"new":null,"old":{"Package":{"name":"httpd","version":"2.4.*"}}}]}`)
testRoute(t, api, "DELETE", "/api/v0/blueprints/delete/test", ``,
http.StatusOK, `{"status":true}`)
}
func TestCompose(t *testing.T) {
@ -193,4 +196,7 @@ func TestCompose(t *testing.T) {
testRoute(t, api, "POST", "/api/v0/compose", `{"blueprint_name": "test","compose_type": "tar","branch": "master"}`,
http.StatusOK, `*`)
testRoute(t, api, "DELETE", "/api/v0/blueprints/delete/test", ``,
http.StatusOK, `{"status":true}`)
}