Logo
Explore Help
Sign In
iSharkFly-Docs/packer-cn
1
0
Fork 0
You've already forked packer-cn
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
packer-cn/helper/useragent/useragent_test.go

21 lines
369 B
Go
Raw Normal View History

Add a common package for specifying useragent and adopt that everywhere There were 5 different formats for the Packer useragent string. This fixes that and unifies it into a helper package. I did not touch oracle's user-agent, because it looked kinda special.
2018-04-04 19:24:21 -07:00
package useragent
import (
"testing"
)
func TestUserAgent(t *testing.T) {
projectURL = "https://packer-test.com"
rt = "go5.0"
Include arch and os
2018-04-05 14:25:11 -04:00
goos = "linux"
goarch = "amd64"
Add a common package for specifying useragent and adopt that everywhere There were 5 different formats for the Packer useragent string. This fixes that and unifies it into a helper package. I did not touch oracle's user-agent, because it looked kinda special.
2018-04-04 19:24:21 -07:00
versionFunc = func() string { return "1.2.3" }
act := String()
Include arch and os
2018-04-05 14:25:11 -04:00
exp := "Packer/1.2.3 (+https://packer-test.com; go5.0; linux/amd64)"
Add a common package for specifying useragent and adopt that everywhere There were 5 different formats for the Packer useragent string. This fixes that and unifies it into a helper package. I did not touch oracle's user-agent, because it looked kinda special.
2018-04-04 19:24:21 -07:00
if exp != act {
t.Errorf("expected %q to be %q", act, exp)
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 136ms Template: 6ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API