Skip to content

Commit

Permalink
fixup! add tests for daemon CLI args
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos authored and hannahhoward committed Jun 26, 2023
1 parent 0bf23f9 commit 46c970b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/lassie/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func TestDaemonCommandFlags(t *testing.T) {
require.Equal(t, "127.0.0.1", hCfg.Address)
require.Equal(t, uint(0), hCfg.Port)
require.Equal(t, uint64(0), hCfg.MaxBlocksPerRequest)
require.Equal(t, "", hCfg.AccessToken)

// event recorder config
require.Equal(t, "", erCfg.EndpointURL)
Expand Down Expand Up @@ -172,6 +173,14 @@ func TestDaemonCommandFlags(t *testing.T) {
return nil
},
},
{
name: "with access token",
args: []string{"daemon", "--access-token", "super-secret"},
assert: func(ctx context.Context, lCfg *l.LassieConfig, hCfg h.HttpServerConfig, erCfg *a.EventRecorderConfig) error {
require.Equal(t, "super-secret", hCfg.AccessToken)
return nil
},
},
}

for _, test := range tests {
Expand Down

0 comments on commit 46c970b

Please sign in to comment.