mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-19 21:39:26 +00:00
Test the case when a plugin reports more than one plugin
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user