Skip to content

Commit 911648e

Browse files
committed
test: test newemlb function
Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
1 parent f440057 commit 911648e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

internal/emlb/emlb_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,23 @@ func Test_getExternalIPv4Target(t *testing.T) {
178178
})
179179
}
180180
}
181+
func TestNewEMLB(t *testing.T) {
182+
metalAPIKey := "metal-api-key" //nolint:gosec
183+
projectID := "project-id"
184+
metro := "am"
185+
186+
emlb := NewEMLB(metalAPIKey, projectID, metro)
187+
188+
if emlb.client == nil {
189+
t.Error("NewEMLB() client is nil")
190+
}
191+
if emlb.tokenExchanger == nil {
192+
t.Error("NewEMLB() tokenExchanger is nil")
193+
}
194+
if emlb.projectID != projectID {
195+
t.Errorf("NewEMLB() projectID = %s, want %s", emlb.projectID, projectID)
196+
}
197+
if emlb.metro != metro {
198+
t.Errorf("NewEMLB() metro = %s, want %s", emlb.metro, metro)
199+
}
200+
}

0 commit comments

Comments
 (0)