mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 04:48:26 +08:00
fix(cli/server): serve command expected positional args (#2382)
fix(cli/server): serve command expected positinal args Expect exactly one positional argument for the serve command with the path to the config file. Signed-off-by: Ramiro Algozino <ramiro@sighup.io>
This commit is contained in:
@@ -48,6 +48,18 @@ func TestServe(t *testing.T) {
|
||||
})
|
||||
|
||||
Convey("Test serve config", t, func(c C) {
|
||||
Convey("no config arg", func(c C) {
|
||||
os.Args = []string{"cli_test", "serve"}
|
||||
err := cli.NewServerRootCmd().Execute()
|
||||
So(err, ShouldNotBeNil)
|
||||
})
|
||||
|
||||
Convey("two args", func(c C) {
|
||||
os.Args = []string{"cli_test", "serve", "config", "second arg"}
|
||||
err := cli.NewServerRootCmd().Execute()
|
||||
So(err, ShouldNotBeNil)
|
||||
})
|
||||
|
||||
Convey("unknown config", func(c C) {
|
||||
os.Args = []string{"cli_test", "serve", path.Join(os.TempDir(), "/x")}
|
||||
err := cli.NewServerRootCmd().Execute()
|
||||
|
||||
Reference in New Issue
Block a user