github.com/kotalco/kotal@v0.3.0/clients/stacks/stacks_node_client_test.go (about)

     1  package stacks
     2  
     3  import (
     4  	"fmt"
     5  
     6  	stacksv1alpha1 "github.com/kotalco/kotal/apis/stacks/v1alpha1"
     7  	"github.com/kotalco/kotal/controllers/shared"
     8  	. "github.com/onsi/ginkgo/v2"
     9  	. "github.com/onsi/gomega"
    10  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    11  )
    12  
    13  var _ = Describe("Stacks node client", func() {
    14  
    15  	node := &stacksv1alpha1.Node{
    16  		ObjectMeta: metav1.ObjectMeta{
    17  			Name:      "stacks-node",
    18  			Namespace: "default",
    19  		},
    20  		Spec: stacksv1alpha1.NodeSpec{
    21  			Network: "mainnet",
    22  		},
    23  	}
    24  
    25  	node.Default()
    26  
    27  	client := NewClient(node)
    28  
    29  	It("Should get correct command", func() {
    30  		Expect(client.Command()).To(Equal(
    31  			[]string{
    32  				StacksNodeCommand,
    33  				StacksStartCommand,
    34  			},
    35  		))
    36  	})
    37  
    38  	It("Should get correct home directory", func() {
    39  		Expect(client.HomeDir()).To(Equal(StacksNodeHomeDir))
    40  	})
    41  
    42  	It("Should generate correct client arguments", func() {
    43  		Expect(client.Args()).To(ContainElements(
    44  			[]string{
    45  				StacksArgConfig,
    46  				fmt.Sprintf("%s/config.toml", shared.PathConfig(client.HomeDir())),
    47  			},
    48  		))
    49  	})
    50  
    51  })