From 8c261a6ee14798cdc5b19e784461021a15ba3618 Mon Sep 17 00:00:00 2001 From: EyePulp Date: Thu, 25 Jan 2024 19:51:51 -0600 Subject: [PATCH] #422 update existing unit tests to not break on new function signature --- source_body_test.go | 4 ++-- source_fs_test.go | 2 +- source_http_test.go | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source_body_test.go b/source_body_test.go index 4d34fb17..0602813b 100644 --- a/source_body_test.go +++ b/source_body_test.go @@ -31,7 +31,7 @@ func TestBodyImageSource(t *testing.T) { t.Fatal("Cannot match the request") } - body, err = source.GetImage(r) + body, _, err = source.GetImage(r) if err != nil { t.Fatalf("Error while reading the body: %s", err) } @@ -59,7 +59,7 @@ func testReadBody(t *testing.T) { t.Fatal("Cannot match the request") } - body, err = source.GetImage(r) + body, _, err = source.GetImage(r) if err != nil { t.Fatalf("Error while reading the body: %s", err) } diff --git a/source_fs_test.go b/source_fs_test.go index 27a3450e..342df0ff 100644 --- a/source_fs_test.go +++ b/source_fs_test.go @@ -19,7 +19,7 @@ func TestFileSystemImageSource(t *testing.T) { t.Fatal("Cannot match the request") } - body, err = source.GetImage(r) + body, _, err = source.GetImage(r) if err != nil { t.Fatalf("Error while reading the body: %s", err) } diff --git a/source_http_test.go b/source_http_test.go index aa542726..08eb6723 100755 --- a/source_http_test.go +++ b/source_http_test.go @@ -27,7 +27,7 @@ func TestHttpImageSource(t *testing.T) { t.Fatal("Cannot match the request") } - body, err = source.GetImage(r) + body, _, err = source.GetImage(r) if err != nil { t.Fatalf("Error while reading the body: %s", err) } @@ -59,7 +59,7 @@ func TestHttpImageSourceAllowedOrigin(t *testing.T) { t.Fatal("Cannot match the request") } - body, err := source.GetImage(r) + body, _, err := source.GetImage(r) if err != nil { t.Fatalf("Error while reading the body: %s", err) } @@ -85,7 +85,7 @@ func TestHttpImageSourceNotAllowedOrigin(t *testing.T) { t.Fatal("Cannot match the request") } - _, err := source.GetImage(r) + _, _, err := source.GetImage(r) if err == nil { t.Fatal("Error cannot be empty") } @@ -256,7 +256,7 @@ func TestHttpImageSourceError(t *testing.T) { t.Fatal("Cannot match the request") } - _, err = source.GetImage(r) + _, _, err = source.GetImage(r) if err == nil { t.Fatalf("Server response should not be valid: %s", err) } @@ -285,7 +285,7 @@ func TestHttpImageSourceExceedsMaximumAllowedLength(t *testing.T) { t.Fatal("Cannot match the request") } - body, err = source.GetImage(r) + body, _, err = source.GetImage(r) if err == nil { t.Fatalf("It should not allow a request to image exceeding maximum allowed size: %s", err) }