github.com/argoproj/argo-cd/v2@v2.10.9/pkg/apiclient/apiclient_test.go (about)

     1  package apiclient
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func Test_parseHeaders(t *testing.T) {
    10  	headerString := []string{"foo:", "foo1:bar1", "foo2:bar2:bar2"}
    11  	headers, err := parseHeaders(headerString)
    12  	assert.NoError(t, err)
    13  	assert.Equal(t, headers.Get("foo"), "")
    14  	assert.Equal(t, headers.Get("foo1"), "bar1")
    15  	assert.Equal(t, headers.Get("foo2"), "bar2:bar2")
    16  }