Test the case when a plugin reports more than one plugin

This commit is contained in:
Krzesimir Nowak
2016-07-15 18:02:15 +02:00
parent 993eebeea9
commit c6b5d98699

View File

@@ -425,6 +425,11 @@ func TestRegistryRejectsErroneousPluginResponses(t *testing.T) {
Name: "changedId",
Handler: stringHandler(http.StatusOK, `{"Plugins":[{"id":"differentId","label":"changedId","interfaces":["reporter"]}]}`),
}.file(),
mockPlugin{
t: t,
Name: "moreThanOnePlugin",
Handler: stringHandler(http.StatusOK, `{"Plugins":[{"id":"moreThanOnePlugin","label":"moreThanOnePlugin","interfaces":["reporter"]}, {"id":"haha","label":"haha","interfaces":["reporter"]}]}`),
}.file(),
)
defer restore(t)
@@ -442,6 +447,11 @@ func TestRegistryRejectsErroneousPluginResponses(t *testing.T) {
Label: "changedId",
Status: `error: plugin must not change its id (is "differentId", should be "changedId")`,
},
{
ID: "moreThanOnePlugin",
Label: "moreThanOnePlugin",
Status: `error: report must contain exactly one plugin (found 2)`,
},
{
ID: "noInterface",
Label: "noInterface",