zot: initial commit

This commit is contained in:
Ramkumar Chinchani
2019-06-20 16:36:40 -07:00
parent 967ff15637
commit 9d4e8b4594
55 changed files with 6478 additions and 2 deletions
+42
View File
@@ -0,0 +1,42 @@
package cli_test
import (
"os"
"testing"
"github.com/anuvu/zot/pkg/cli"
. "github.com/smartystreets/goconvey/convey"
)
func TestUsage(t *testing.T) {
oldArgs := os.Args
defer func() { os.Args = oldArgs }()
Convey("Test Usage", t, func(c C) {
os.Args = []string{"cli_test", "help"}
err := cli.NewRootCmd().Execute()
So(err, ShouldBeNil)
})
}
func TestServe(t *testing.T) {
oldArgs := os.Args
defer func() { os.Args = oldArgs }()
Convey("Test Usage", t, func(c C) {
os.Args = []string{"cli_test", "serve", "-h"}
err := cli.NewRootCmd().Execute()
So(err, ShouldBeNil)
})
}
func TestGC(t *testing.T) {
oldArgs := os.Args
defer func() { os.Args = oldArgs }()
Convey("Test Usage", t, func(c C) {
os.Args = []string{"cli_test", "garbage-collect", "-h"}
err := cli.NewRootCmd().Execute()
So(err, ShouldBeNil)
})
}