(t *testing.T)
| 194 | } |
| 195 | |
| 196 | func TestDetectTenant_DirectToken(t *testing.T) { |
| 197 | t.Setenv(EnvPlatformToken, cqpdTokenWithURL(t, "https://acme.us.platform.cloudquery.io")) |
| 198 | url, ok := DetectTenant(context.Background(), "", "") |
| 199 | require.True(t, ok, "a CQ_PLATFORM_TOKEN means a tenant is present") |
| 200 | require.Equal(t, "https://acme.us.platform.cloudquery.io", url, "url comes from the token's u claim") |
| 201 | } |
| 202 | |
| 203 | func TestDetectTenant_Disabled(t *testing.T) { |
| 204 | t.Setenv(envDisable, "1") |
nothing calls this directly
no test coverage detected