github.com/wostzone/hub/auth@v0.0.0-20220118060317-7bb375743b17/cmd/auth/auth_test.go (about)

     1  package main
     2  
     3  import (
     4  	"os"
     5  	"path"
     6  	"strings"
     7  	"testing"
     8  )
     9  
    10  func TestArgs(t *testing.T) {
    11  	wd, _ := os.Getwd()
    12  	homeFolder := path.Join(wd, "../../test")
    13  	os.Chdir(homeFolder)
    14  	fp, _ := os.Create("config/test.acl")
    15  	fp.Close()
    16  
    17  	// cmdline := "certbundle"
    18  	// cmdline := "clientcert client1"
    19  	// cmdline := "setpassword client1 bob -c ./config"
    20  	cmdline := "setrole client1 group1 viewer --aclfile=config/test.acl"
    21  	args := strings.Split(cmdline, " ")
    22  	ParseArgs(homeFolder, args)
    23  }
    24  
    25  func TestNoArgs(t *testing.T) {
    26  
    27  }