From ec78765e4ff99268478a67b1f4cc0921f89467f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Sun, 8 Dec 2024 18:08:34 +0100 Subject: [PATCH] Fix tests --- nodes/main_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nodes/main_test.go b/nodes/main_test.go index 4c1a907..31b1d2c 100644 --- a/nodes/main_test.go +++ b/nodes/main_test.go @@ -32,11 +32,12 @@ func TestNodesProcessor_Refresh(t *testing.T) { np.Refresh("test", Labels{"mylabel"}, KV{"mykey": "my value"}) np.Refresh("test2", Labels{"mylabel3"}, KV{"mykey3": "my value3"}) - nodes := np.List() - assert.Equal(t, "test", nodes[0].HostName) - assert.Contains(t, nodes[0].Labels, "mylabel") - assert.Equal(t, "test2", nodes[1].HostName) - assert.Contains(t, nodes[1].Labels, "mylabel3") + nodeTest, _ := np.Get("test") + nodeTest2, _ := np.Get("test2") + assert.Equal(t, "test", nodeTest.HostName) + assert.Contains(t, nodeTest.Labels, "mylabel") + assert.Equal(t, "test2", nodeTest2.HostName) + assert.Contains(t, nodeTest2.Labels, "mylabel3") } func TestNodesProcessor_DumpLoad(t *testing.T) {