From 8a3c02a69314657d8b52cd69e510c0b771bff88b Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Mon, 29 Apr 2024 08:17:17 -0400 Subject: [PATCH] Expand IsEnterprise test cases Adding API hosts to TestIsEnterprise to ensure that normalized hosts work as expected. --- pkg/auth/auth_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/auth/auth_test.go b/pkg/auth/auth_test.go index ec1e821..0588a1c 100644 --- a/pkg/auth/auth_test.go +++ b/pkg/auth/auth_test.go @@ -237,11 +237,21 @@ func TestIsEnterprise(t *testing.T) { host: "github.com", wantOut: false, }, + { + name: "github API", + host: "api.github.com", + wantOut: false, + }, { name: "localhost", host: "github.localhost", wantOut: false, }, + { + name: "localhost API", + host: "api.github.localhost", + wantOut: false, + }, { name: "enterprise", host: "mygithub.com", @@ -252,6 +262,11 @@ func TestIsEnterprise(t *testing.T) { host: "tenant.ghe.com", wantOut: false, }, + { + name: "tenant API", + host: "api.tenant.ghe.com", + wantOut: false, + }, } for _, tt := range tests {