mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Fix AssertCalls usage for kubelet fake runtimes
Despite its name, AssertCalls() does not assert anything. It returns an error that must be checked. This was causing false negatives for a handful of unit tests.
This commit is contained in:
@@ -57,7 +57,7 @@ func TestCreatePodSandbox(t *testing.T) {
|
||||
}
|
||||
id, _, err := m.createPodSandbox(pod, 1)
|
||||
assert.NoError(t, err)
|
||||
fakeRuntime.AssertCalls([]string{"RunPodSandbox"})
|
||||
assert.Contains(t, fakeRuntime.Called, "RunPodSandbox")
|
||||
sandboxes, err := fakeRuntime.ListPodSandbox(&runtimeapi.PodSandboxFilter{Id: id})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, len(sandboxes), 1)
|
||||
|
||||
Reference in New Issue
Block a user