Skip to content

Commit d76ab58

Browse files
author
childish-sambino
authored
fix: revert client submodule creation (#91)
This causes more problems than it solves. Need to look for other ways of testing the OpenAPI generator fixture.
1 parent bf0945b commit d76ab58

File tree

6 files changed

+11
-2305
lines changed

6 files changed

+11
-2305
lines changed

client/client_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

1010
"github.com/stretchr/testify/assert"
1111
twilio "github.com/twilio/twilio-go/client"
12-
"github.com/twilio/twilio-go/framework/error"
1312
)
1413

1514
func NewClient(accountSid string, authToken string) *twilio.Client {
@@ -37,7 +36,7 @@ func TestClient_SendRequestError(t *testing.T) {
3736

3837
client := NewClient("user", "pass")
3938
resp, err := client.SendRequest("get", mockServer.URL, nil, nil) //nolint:bodyclose
40-
twilioError := err.(*error.TwilioRestError)
39+
twilioError := err.(*twilio.TwilioRestError)
4140
assert.Nil(t, resp)
4241
assert.Equal(t, 400, twilioError.Status)
4342
assert.Equal(t, 20001, twilioError.Code)
@@ -65,7 +64,7 @@ func TestClient_SendRequestErrorWithDetails(t *testing.T) {
6564

6665
client := NewClient("user", "pass")
6766
resp, err := client.SendRequest("get", mockServer.URL, nil, nil) //nolint:bodyclose
68-
twilioError := err.(*error.TwilioRestError)
67+
twilioError := err.(*twilio.TwilioRestError)
6968
details := make(map[string]interface{})
7069
details["foo"] = "bar"
7170
assert.Nil(t, resp)

client/error_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"testing"
77

88
assert "github.com/stretchr/testify/require"
9-
"github.com/twilio/twilio-go/framework/error"
9+
"github.com/twilio/twilio-go/client"
1010
)
1111

1212
const (
@@ -19,7 +19,7 @@ const (
1919
func TestTwilioRestError_Error(t *testing.T) {
2020
details := make(map[string]interface{})
2121
details["foo"] = "bar"
22-
err := &error.TwilioRestError{
22+
err := &client.TwilioRestError{
2323
Code: errorCode,
2424
Details: details,
2525
Message: errorMessage,
@@ -31,7 +31,7 @@ func TestTwilioRestError_Error(t *testing.T) {
3131
}
3232

3333
func TestTwilioRestError_NoDetails(t *testing.T) {
34-
err := &error.TwilioRestError{}
34+
err := &client.TwilioRestError{}
3535
response := `{"code":20001,"message":"Bad request","more_info":"https://www.twilio.com/docs/errors/20001","status":400}`
3636
responseReader := strings.NewReader(response)
3737
decodeErr := json.NewDecoder(responseReader).Decode(err)

client/go.mod

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)