herald.go/server/args_test.go
Jeffrey Picard b9f7d595bd
Herald.go (#47)
* switch herald to herald.go

* update ci/cd stuff

* fix issues with binary name

* we're no longer building dynamically, so turn CGO back on, and fix names

* update package names in proto files
2022-08-09 14:43:01 +03:00

36 lines
582 B
Go

package server
import (
"os"
"testing"
pb "github.com/lbryio/herald.go/protobuf/go"
)
// TestParseArgs
func TestParseArgs(t *testing.T) {
tests := []struct {
name string
want bool
}{
{
name: "Correctly disables elastic search",
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
os.Args = []string{"serve", "--disable-es"}
searchRequest := new(pb.SearchRequest)
args := ParseArgs(searchRequest)
got := args.DisableEs
if got != tt.want {
t.Errorf("flags: got: %v, want: %v\n", got, tt.want)
}
})
}
}