Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshay Avinash committed Oct 22, 2024
1 parent 8a68a26 commit 37dccca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/unit/storages/test_key_value_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import asyncio
from typing import AsyncGenerator
from urllib.parse import unquote, urlparse
from urllib.parse import urlparse

import pytest

Expand Down Expand Up @@ -108,7 +108,8 @@ async def test_static_get_public_url(key_value_store: KeyValueStore) -> None:
await key_value_store.set_value('test-static', 'static')
public_url = await key_value_store.get_public_url('test-static')

path = unquote(urlparse(public_url).path) # extract path from a 'file:///' URI
url = urlparse(public_url)
path = url.netloc if url.netloc else url.path

f = await asyncio.to_thread(open, path, mode='r')
assert f.read() == 'static'

0 comments on commit 37dccca

Please sign in to comment.