| Conditions | 3 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package credentials |
||
| 11 | func TestURLCredential_updateCredential(t *testing.T) { |
||
| 12 | URLCredential := newURLCredential("http://127.0.0.1") |
||
| 13 | hookDo = func(fn func(req *http.Request) (*http.Response, error)) func(req *http.Request) (*http.Response, error) { |
||
| 14 | return func(req *http.Request) (*http.Response, error) { |
||
| 15 | return mockResponse(300, ``, errors.New("sdk test")) |
||
| 16 | } |
||
| 17 | } |
||
| 18 | accesskeyId, err := URLCredential.GetAccessKeyId() |
||
| 19 | // assert.NotNil(t, err) |
||
| 20 | assert.Equal(t, "refresh Ecs sts token err: sdk test", err.Error()) |
||
| 21 | assert.Equal(t, "", *accesskeyId) |
||
| 22 | |||
| 23 | assert.Equal(t, "credential_uri", *URLCredential.GetType()) |
||
| 24 | } |
||
| 25 |