From 6a66592b628dc417cfed1e53f53de1212d414237 Mon Sep 17 00:00:00 2001 From: Tina Wuest Date: Tue, 22 Dec 2015 00:05:28 -0600 Subject: [PATCH 1/2] Add func to set root url for integration testing --- client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client.go b/client.go index 8f6cfc4..83d02e5 100644 --- a/client.go +++ b/client.go @@ -16,6 +16,7 @@ type Client interface { AccountSid() string AuthToken() string RootUrl() string + UpdateRoot(string) get(url.Values, string) ([]byte, error) post(url.Values, string) ([]byte, error) delete(string) error @@ -172,3 +173,7 @@ func (client *TwilioClient) buildUri(parts ...string) string { } return strings.Join(newParts, "/") } + +func (client *TwilioClient) UpdateRoot(root string) { + client.rootUrl = root + "/" + VERSION + "/Accounts/" + client.accountSid +} From 2418d30a4b5a455162c88b171f73f175910eb906 Mon Sep 17 00:00:00 2001 From: Tina Wuest Date: Mon, 28 Dec 2015 10:40:09 -0600 Subject: [PATCH 2/2] Add UpdateRoot function to mock --- mock_client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mock_client.go b/mock_client.go index 39fccce..2179839 100644 --- a/mock_client.go +++ b/mock_client.go @@ -36,3 +36,6 @@ func (client *MockClient) delete(uri string) error { args := client.Mock.Called(nil, uri) return args.Error(1) } + +func (client *MockClient) UpdateRoot(_ string) { +}