add UserAgent field and methods to ProviderClient
diff --git a/provider_client_test.go b/provider_client_test.go
index b260246..8fd20f8 100644
--- a/provider_client_test.go
+++ b/provider_client_test.go
@@ -14,3 +14,22 @@
actual := p.AuthenticatedHeaders()
th.CheckDeepEquals(t, expected, actual)
}
+
+func TestUserAgent(t *testing.T) {
+ p := &ProviderClient{}
+
+ p.UserAgent.Prepend("custom-user-agent/v2.4")
+ expected := "custom-user-agent/v2.4 gophercloud/v1.0"
+ actual := p.UserAgent.Join()
+ th.CheckEquals(t, expected, actual)
+
+ p.UserAgent.Prepend("another-custom-user-agent/v0.3", "a-third-ua/v5.9")
+ expected = "another-custom-user-agent/v0.3 a-third-ua/v5.9 custom-user-agent/v2.4 gophercloud/v1.0"
+ actual = p.UserAgent.Join()
+ th.CheckEquals(t, expected, actual)
+
+ p.UserAgent = UserAgent{}
+ expected = "gophercloud/v1.0"
+ actual = p.UserAgent.Join()
+ th.CheckEquals(t, expected, actual)
+}