Skip to content

Commit 1676a33

Browse files
authored
Merge pull request #74 from supabase-community/j0_fix_test_instance_settings
Update Test instance settings
2 parents e3185b1 + a9b29fb commit 1676a33

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

Diff for: supabase/lib/storage/storage_bucket_api.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
from collections.abc import Awaitable
44
from dataclasses import dataclass
55
from datetime import datetime
6-
from typing import Any, Literal, Optional, Type, Union
6+
from typing import Any, Dict, List, Optional, Type, Union
77

88
from httpx import AsyncClient, Client, HTTPError
99

1010
__all__ = ["Bucket", "StorageBucketAPI"]
1111

12-
_RequestMethod = Literal["GET", "POST", "PUT", "DELETE", "PATCH"]
12+
_RequestMethod = str
1313

1414

1515
class StorageException(Exception):
@@ -33,10 +33,10 @@ def __post_init__(self) -> None:
3333

3434

3535
ResponseType = Union[
36-
dict[
36+
Dict[
3737
str, str
3838
], # response from an endpoint without a custom response_class, example: create_bucket
39-
list[
39+
List[
4040
Bucket
4141
], # response from an endpoint which returns a list of objects, example: list_buckets
4242
Bucket, # response from an endpoint which returns a single object, example: get_bucket
@@ -80,7 +80,7 @@ def _sync_request(
8080
response_class: Optional[Type] = None,
8181
) -> ResponseType:
8282
if isinstance(self._client, AsyncClient): # only to appease the type checker
83-
return
83+
return None
8484

8585
response = self._client.request(method, url, json=json)
8686
try:

Diff for: test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
2-
SUPABASE_TEST_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYxMjYwOTMyMiwiZXhwIjoxOTI4MTg1MzIyfQ.XL9W5I_VRQ4iyQHVQmjG0BkwRfx6eVyYB3uAKcesukg" \
3-
SUPABASE_TEST_URL="https://tfsatoopsijgjhrqplra.supabase.co" \
2+
SUPABASE_TEST_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYzNTAwODQ4NywiZXhwIjoxOTUwNTg0NDg3fQ.l8IgkO7TQokGSc9OJoobXIVXsOXkilXl4Ak6SCX5qI8" \
3+
SUPABASE_TEST_URL="https://ibrydvrsxoapzgtnhpso.supabase.co" \
44
poetry run pytest

Diff for: tests/test_client.py

-14
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,3 @@ def test_client_insert(supabase: Client) -> None:
8383
assert current_length == previous_length + 1
8484
# Check returned result for insert was valid.
8585
assert result.get("status_code", 400) == 201
86-
87-
88-
def test_client_bucket(supabase: Client) -> None:
89-
90-
"""Ensure that the storage bucket operations work"""
91-
TEST_BUCKET_NAME = "atestbucket"
92-
# TODO[Joel] - Reinstate once permissions on test instance are updated
93-
# storage = supabase.storage()
94-
# storage_bucket = storage.StorageBucketAPI()
95-
# storage_bucket.create_bucket(TEST_BUCKET_NAME)
96-
# storage_bucket.list_buckets()
97-
# storage_bucket.get_bucket(TEST_BUCKET_NAME)
98-
# storage_bucket.empty_bucket(TEST_BUCKET_NAME)
99-
# storage_bucket.delete_bucket(TEST_BUCKET_NAME)

0 commit comments

Comments
 (0)