From 0d23d919dd3a6a5973b5868b3abf20decceb9beb Mon Sep 17 00:00:00 2001 From: Tim Holm Date: Tue, 8 Nov 2022 08:55:42 +1100 Subject: [PATCH] test: check the URL is returned. --- tests/api/test_storage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/api/test_storage.py b/tests/api/test_storage.py index fa679d0..22e8ffc 100644 --- a/tests/api/test_storage.py +++ b/tests/api/test_storage.py @@ -103,7 +103,7 @@ async def test_sign_url(self): with patch("nitricapi.nitric.storage.v1.StorageServiceStub.pre_sign_url", mock_pre_sign_url): bucket = Storage().bucket("test-bucket") file = bucket.file("test-file") - await file.sign_url() + url = await file.sign_url() # Check expected values were passed to Stub mock_pre_sign_url.assert_called_once_with( @@ -115,6 +115,9 @@ async def test_sign_url(self): ) ) + # check the URL is returned + assert url == "www.example.com" + async def test_write_error(self): mock_write = AsyncMock() mock_write.side_effect = GRPCError(Status.UNKNOWN, "test error")