diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2018-02-19 17:58:08 +0100 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2018-02-19 17:58:08 +0100 |
| commit | d1dec3782fb5f9aa5775dafb0ea1225af6279ed2 (patch) | |
| tree | 8f06c0fbcc3c93b18ce0c90cb2e4b0f3b8d08f29 /field_test.go | |
| parent | 502acc3c73e789e856a17b878889db4356fe898c (diff) | |
| download | go-schwift-d1dec3782fb5f9aa5775dafb0ea1225af6279ed2.tar.gz | |
replace expectError by expectSuccess where possible
Diffstat (limited to 'field_test.go')
| -rw-r--r-- | field_test.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/field_test.go b/field_test.go index c86f07d..539ed74 100644 --- a/field_test.go +++ b/field_test.go @@ -28,17 +28,17 @@ func TestFieldString(t *testing.T) { hdr := make(AccountHeaders) expectBool(t, hdr.TempURLKey().Exists(), false) expectString(t, hdr.TempURLKey().Get(), "") - expectError(t, hdr.Validate(), "") + expectSuccess(t, hdr.Validate()) hdr["X-Account-Meta-Temp-Url-Key"] = "" expectBool(t, hdr.TempURLKey().Exists(), false) expectString(t, hdr.TempURLKey().Get(), "") - expectError(t, hdr.Validate(), "") + expectSuccess(t, hdr.Validate()) hdr["X-Account-Meta-Temp-Url-Key"] = "foo" expectBool(t, hdr.TempURLKey().Exists(), true) expectString(t, hdr.TempURLKey().Get(), "foo") - expectError(t, hdr.Validate(), "") + expectSuccess(t, hdr.Validate()) hdr.TempURLKey().Set("bar") expectHeaders(t, hdr, map[string]string{ @@ -61,7 +61,7 @@ func TestFieldString(t *testing.T) { func TestFieldTimestamp(t *testing.T) { testWithAccount(t, func(a *Account) { hdr, err := a.Headers() - if !expectError(t, err, "") { + if !expectSuccess(t, err) { return } @@ -75,7 +75,7 @@ func TestFieldTimestamp(t *testing.T) { hdr := make(AccountHeaders) expectBool(t, hdr.CreatedAt().Exists(), false) expectBool(t, hdr.CreatedAt().Get().IsZero(), true) - expectError(t, hdr.Validate(), "") + expectSuccess(t, hdr.Validate()) hdr["X-Timestamp"] = "wtf" expectBool(t, hdr.CreatedAt().Exists(), true) @@ -105,7 +105,7 @@ func TestFieldHTTPTimestamp(t *testing.T) { hdr := make(ObjectHeaders) expectBool(t, hdr.UpdatedAt().Exists(), false) expectBool(t, hdr.UpdatedAt().Get().IsZero(), true) - expectError(t, hdr.Validate(), "") + expectSuccess(t, hdr.Validate()) hdr["Last-Modified"] = "wtf" expectBool(t, hdr.UpdatedAt().Exists(), true) @@ -119,12 +119,12 @@ func TestFieldUint64(t *testing.T) { hdr := make(AccountHeaders) expectBool(t, hdr.BytesUsedQuota().Exists(), false) expectUint64(t, hdr.BytesUsedQuota().Get(), 0) - expectError(t, hdr.Validate(), "") + expectSuccess(t, hdr.Validate()) hdr["X-Account-Meta-Quota-Bytes"] = "23" expectBool(t, hdr.BytesUsedQuota().Exists(), true) expectUint64(t, hdr.BytesUsedQuota().Get(), 23) - expectError(t, hdr.Validate(), "") + expectSuccess(t, hdr.Validate()) hdr["X-Account-Meta-Quota-Bytes"] = "-23" expectBool(t, hdr.BytesUsedQuota().Exists(), true) @@ -151,12 +151,12 @@ func TestFieldUint64Readonly(t *testing.T) { hdr := make(AccountHeaders) expectBool(t, hdr.BytesUsed().Exists(), false) expectUint64(t, hdr.BytesUsed().Get(), 0) - expectError(t, hdr.Validate(), "") + expectSuccess(t, hdr.Validate()) hdr["X-Account-Bytes-Used"] = "23" expectBool(t, hdr.BytesUsed().Exists(), true) expectUint64(t, hdr.BytesUsed().Get(), 23) - expectError(t, hdr.Validate(), "") + expectSuccess(t, hdr.Validate()) hdr["X-Account-Bytes-Used"] = "-23" expectBool(t, hdr.BytesUsed().Exists(), true) |
