Change assertion order in tests.

varsha/versions
Varsha Varadarajan 2019-06-19 19:19:09 -04:00
parent 049292bd67
commit b2768bdb56
4 changed files with 6 additions and 4 deletions

View File

@ -144,9 +144,9 @@ func TestLatestTagWarning(t *testing.T) {
for _, scenario := range scenarios {
t.Run(scenario.name, func(t *testing.T) {
w, e, err := latestTagCheck.Run(scenario.arg)
assert.NoError(t, err)
assert.ElementsMatch(t, scenario.expected, w)
assert.Empty(t, e)
assert.Nil(t, err)
})
}
}

View File

@ -40,9 +40,9 @@ func TestNamespaceWarning(t *testing.T) {
for _, scenario := range scenarios {
t.Run(scenario.name, func(t *testing.T) {
w, e, err := namespace.Run(scenario.arg)
assert.NoError(t, err)
assert.ElementsMatch(t, scenario.expected, w)
assert.Empty(t, e)
assert.Nil(t, err)
})
}
}

View File

@ -47,8 +47,10 @@ func TestNodeNameError(t *testing.T) {
for _, scenario := range scenarios {
t.Run(scenario.name, func(t *testing.T) {
_, e, _ := podSelectorCheck.Run(scenario.arg)
w, e, err := podSelectorCheck.Run(scenario.arg)
assert.NoError(t, err)
assert.ElementsMatch(t, scenario.expected, e)
assert.Empty(t, w)
})
}
}

View File

@ -83,9 +83,9 @@ func TestPrivilegedContainerWarning(t *testing.T) {
for _, scenario := range scenarios {
t.Run(scenario.name, func(t *testing.T) {
w, e, err := privilegedContainerCheck.Run(scenario.arg)
assert.NoError(t, err)
assert.ElementsMatch(t, scenario.expected, w)
assert.Empty(t, e)
assert.Nil(t, err)
})
}
}