mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-06 16:04:26 +01:00
tests: Add cli.Context helper functions
Created two new helper functions to create a `cli.Context` with and without a `cli.App`. Calling these functions simplifies a lot of test code. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
@@ -21,7 +21,7 @@ func TestSpecCliAction(t *testing.T) {
|
||||
assert.True(ok)
|
||||
|
||||
flagSet := flag.NewFlagSet("flag", flag.ContinueOnError)
|
||||
ctx := cli.NewContext(&cli.App{}, flagSet, nil)
|
||||
ctx := createCLIContext(flagSet)
|
||||
defer os.Remove(specConfig)
|
||||
err := actionFunc(ctx)
|
||||
assert.NoError(err)
|
||||
|
||||
Reference in New Issue
Block a user