forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added endpoint suffix to service user for pkce token saved in token c…
…ache (flyteorg#264) * Added endpoint suffix to service user for pkce token saved in token cache Signed-off-by: Prafulla Mahindrakar <[email protected]> * nits Signed-off-by: Prafulla Mahindrakar <[email protected]>
- Loading branch information
1 parent
dbb00f5
commit ab1371d
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package cmdcore | ||
|
||
import ( | ||
"context" | ||
"net/url" | ||
"testing" | ||
|
||
"github.com/flyteorg/flyteidl/clients/go/admin" | ||
"github.com/flyteorg/flytestdlib/config" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func testCommandFunc(ctx context.Context, args []string, cmdCtx CommandContext) error { | ||
return nil | ||
} | ||
|
||
func TestGenerateCommandFunc(t *testing.T) { | ||
adminCfg := admin.GetConfig(context.Background()) | ||
adminCfg.Endpoint = config.URL{URL: url.URL{Host: "dummyHost"}} | ||
adminCfg.AuthType = admin.AuthTypePkce | ||
rootCmd := &cobra.Command{} | ||
cmdEntry := CommandEntry{CmdFunc: testCommandFunc, ProjectDomainNotRequired: true} | ||
fn := generateCommandFunc(cmdEntry) | ||
assert.Nil(t, fn(rootCmd, []string{})) | ||
} |