Skip to content

Commit

Permalink
test: check the URL is returned.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjholm committed Nov 7, 2022
1 parent ffcc097 commit 0d23d91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/api/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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")
Expand Down

0 comments on commit 0d23d91

Please sign in to comment.