Skip to content

Commit 9afca84

Browse files
committed
Expand tenancy test cases
Including API cases for tenancy checks, ensuring that hosts are normalized.
1 parent 29dc50b commit 9afca84

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pkg/auth/auth_test.go

+15
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,21 @@ func TestIsTenancy(t *testing.T) {
273273
host: "github.com",
274274
wantOut: false,
275275
},
276+
{
277+
name: "github API",
278+
host: "api.github.com",
279+
wantOut: false,
280+
},
276281
{
277282
name: "localhost",
278283
host: "github.localhost",
279284
wantOut: false,
280285
},
286+
{
287+
name: "localhost API",
288+
host: "api.github.localhost",
289+
wantOut: false,
290+
},
281291
{
282292
name: "enterprise",
283293
host: "mygithub.com",
@@ -288,6 +298,11 @@ func TestIsTenancy(t *testing.T) {
288298
host: "tenant.ghe.com",
289299
wantOut: true,
290300
},
301+
{
302+
name: "tenant API",
303+
host: "api.tenant.ghe.com",
304+
wantOut: true,
305+
},
291306
}
292307

293308
for _, tt := range tests {

0 commit comments

Comments
 (0)