open-vault/helper/useragent/useragent_test.go
Seth Vargo b5e4db975e Add useragent helper (#3991)
* Add useragent package

This helper provides a consistent user-agent header for Vault, taking into account different versions.

* Add user-agent headers to spanner and gcs
2018-02-15 18:30:31 -05:00

19 lines
319 B
Go

package useragent
import (
"testing"
)
func TestUserAgent(t *testing.T) {
projectURL = "https://vault-test.com"
rt = "go5.0"
versionFunc = func() string { return "1.2.3" }
act := String()
exp := "Vault/1.2.3 (+https://vault-test.com; go5.0)"
if exp != act {
t.Errorf("expected %q to be %q", act, exp)
}
}