herald.go/server/args_test.go
Jeffrey Picard b2dd70bc7c
Jeffreypicard/feature/move to herald (#37)
* changes for repo move

* Go back to protobuf 1.27.1, update go to 1.18

* update readme for new rocksdb version
2022-07-11 20:31:27 +03:00

35 lines
579 B
Go

package server
import (
"os"
"testing"
pb "github.com/lbryio/herald/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)
}
})
}
}