aboutsummaryrefslogtreecommitdiff
path: root/headers_test.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2018-02-07 20:45:42 +0100
committerStefan Majewsky <majewsky@gmx.net>2018-02-07 20:45:42 +0100
commit70d9fc2a699624f8fc87f1c5837241c536087373 (patch)
tree15f644c79d6012a8cd03291eff9a859e641a2606 /headers_test.go
parent99ef0307e75fecc469f63a82bb72d1b697e14fff (diff)
downloadgo-schwift-70d9fc2a699624f8fc87f1c5837241c536087373.tar.gz
increase test coverage
Diffstat (limited to 'headers_test.go')
-rw-r--r--headers_test.go43
1 files changed, 1 insertions, 42 deletions
diff --git a/headers_test.go b/headers_test.go
index f8b604c..d068623 100644
--- a/headers_test.go
+++ b/headers_test.go
@@ -36,7 +36,7 @@ func TestParseAccountHeadersSuccess(t *testing.T) {
expectUint64(t, headers.BytesUsed().Get(), 1234)
expectUint64(t, headers.ContainerCount().Get(), 23)
expectUint64(t, headers.ObjectCount().Get(), 42)
- expectUint64(t, headers.QuotaBytes().Get(), 1048576)
+ expectUint64(t, headers.BytesUsedQuota().Get(), 1048576)
expectString(t, headers.Metadata().Get("foo"), "bar")
expectString(t, headers.Metadata().Get("Foo"), "bar")
@@ -44,44 +44,3 @@ func TestParseAccountHeadersSuccess(t *testing.T) {
}
//TODO TestParseAccountHeadersError
-
-func expectBool(t *testing.T, actual bool, expected bool) {
- t.Helper()
- if actual != expected {
- t.Errorf("expected value %#v, got %#v instead\n", expected, actual)
- }
-}
-
-func expectUint64(t *testing.T, actual uint64, expected uint64) {
- t.Helper()
- if actual != expected {
- t.Errorf("expected value %d, got %d instead\n", expected, actual)
- }
-}
-
-func expectString(t *testing.T, actual string, expected string) {
- t.Helper()
- if actual != expected {
- t.Errorf("expected value %q, got %q instead\n", expected, actual)
- }
-}
-
-func expectError(t *testing.T, actual error, expected string) (ok bool) {
- t.Helper()
- if actual == nil {
- if expected != "" {
- t.Errorf("expected error %q, got no error\n", expected)
- return false
- }
- } else {
- if expected == "" {
- t.Errorf("expected no error, got %q\n", actual.Error())
- return false
- } else if expected != actual.Error() {
- t.Errorf("expected error %q, got %q instead\n", expected, actual.Error())
- return false
- }
- }
-
- return true
-}