-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28a4a7b
commit 3618315
Showing
2 changed files
with
37 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,7 +140,7 @@ func TestSDKError(t *testing.T) { | |
}, | ||
}) | ||
utils.AssertNotNil(t, err) | ||
utils.AssertEqual(t, "SDKError: code message {\"hostId\":\"github.com/alibabacloud/tea\",\"httpCode\":\"404\",\"requestId\":\"dfadfa32cgfdcasd4313\"}", err.Error()) | ||
utils.AssertEqual(t, "SDKError:\n Code: code\n Message: message\n Data: {\"hostId\":\"github.com/alibabacloud/tea\",\"httpCode\":\"404\",\"requestId\":\"dfadfa32cgfdcasd4313\"}\n", err.Error()) | ||
} | ||
|
||
func TestSDKErrorCode404(t *testing.T) { | ||
|
@@ -149,7 +149,7 @@ func TestSDKErrorCode404(t *testing.T) { | |
"message": "message", | ||
}) | ||
utils.AssertNotNil(t, err) | ||
utils.AssertEqual(t, "SDKError: 404 message ", err.Error()) | ||
utils.AssertEqual(t, "SDKError:\n Code: 404\n Message: message\n Data: \n", err.Error()) | ||
} | ||
|
||
func TestToObject(t *testing.T) { | ||
|
@@ -335,14 +335,14 @@ func Test_DoRequest(t *testing.T) { | |
} | ||
} | ||
request := NewRequest() | ||
request.Port = 80 | ||
request.Method = "TEA TEST" | ||
request.Port = Int(80) | ||
request.Method = String("TEA TEST") | ||
resp, err := DoRequest(request, nil) | ||
utils.AssertNil(t, resp) | ||
utils.AssertEqual(t, `net/http: invalid method "TEA TEST"`, err.Error()) | ||
|
||
request.Method = "" | ||
request.Protocol = "https" | ||
request.Method = String("") | ||
request.Protocol = String("https") | ||
request.Query = map[string]string{ | ||
"tea": "test", | ||
} | ||
|
@@ -351,7 +351,7 @@ func Test_DoRequest(t *testing.T) { | |
utils.AssertNil(t, resp) | ||
utils.AssertEqual(t, `parse # #%gfdf: invalid URL escape "%gf"`, err.Error()) | ||
|
||
request.Pathname = "?log" | ||
request.Pathname = String("?log") | ||
request.Headers["tea"] = "" | ||
runtimeObj["httpsProxy"] = "http://someuser:[email protected]" | ||
resp, err = DoRequest(request, runtimeObj) | ||
|