Skip to content

Commit 5f7b3bb

Browse files
authored
Merge pull request #29 from supabase/j0_test_precommit
Format unformatted files
2 parents 434d6ba + 4776baa commit 5f7b3bb

File tree

5 files changed

+20
-17
lines changed

5 files changed

+20
-17
lines changed

.github/workflows/pre-commit_hooks.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pre-commit
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
build:

supabase_py/client.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
from supabase_py.lib.realtime_client import SupabaseRealtimeClient
88
from supabase_py.lib.supabase_storage_client import SupabaseStorageClient
99

10-
11-
from typing import Any, Dict
12-
13-
1410
DEFAULT_OPTIONS = {
1511
"schema": "public",
1612
"auto_refresh_token": True,
@@ -149,9 +145,13 @@ def get_subscriptions(self):
149145
return self.realtime.channels
150146

151147
@staticmethod
152-
def _init_realtime_client(realtime_url: str, supabase_key: str) -> SupabaseRealtimeClient:
148+
def _init_realtime_client(
149+
realtime_url: str, supabase_key: str
150+
) -> SupabaseRealtimeClient:
153151
"""Private method for creating an instance of the realtime-py client."""
154-
return SupabaseRealtimeClient(realtime_url, {"params": {"apikey": supabase_key}})
152+
return SupabaseRealtimeClient(
153+
realtime_url, {"params": {"apikey": supabase_key}}
154+
)
155155

156156
@staticmethod
157157
def _init_supabase_auth_client(

supabase_py/lib/storage/storage_bucket_api.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Dict, Any
1+
from typing import Any, Dict
22

33
import requests
44
from requests import HTTPError
@@ -50,7 +50,9 @@ def create_bucket(self, id: str) -> Dict[str, Any]:
5050
A unique identifier for the bucket you are creating.
5151
"""
5252
try:
53-
response = requests.post(f"{self.url}/bucket", data={"id": id}, headers=self.headers)
53+
response = requests.post(
54+
f"{self.url}/bucket", data={"id": id}, headers=self.headers
55+
)
5456
response.raise_for_status()
5557
except HTTPError as http_err:
5658
print(f"HTTP error occurred: {http_err}") # Python 3.6
@@ -68,7 +70,9 @@ def empty_bucket(self, id: str) -> Dict[str, Any]:
6870
The unique identifier of the bucket you would like to empty.
6971
"""
7072
try:
71-
response = requests.post(f"{self.url}/bucket/{id}/empty", data={}, headers=self.headers)
73+
response = requests.post(
74+
f"{self.url}/bucket/{id}/empty", data={}, headers=self.headers
75+
)
7276
response.raise_for_status()
7377
except HTTPError as http_err:
7478
print(f"HTTP error occurred: {http_err}") # Python 3.6
@@ -87,7 +91,9 @@ def delete_bucket(self, id: str) -> Dict[str, Any]:
8791
The unique identifier of the bucket you would like to delete.
8892
"""
8993
try:
90-
response = requests.delete(f"{self.url}/bucket/{id}", data={}, headers=self.headers)
94+
response = requests.delete(
95+
f"{self.url}/bucket/{id}", data={}, headers=self.headers
96+
)
9197

9298
response.raise_for_status()
9399
except HTTPError as http_err:

tests/test_client.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def _assert_authenticated_user(data: Dict[str, Any]) -> None:
2626
assert user.get("aud") == "authenticated"
2727

2828

29-
@pytest.mark.xfail(reason="None of these values should be able to instanciate a client object")
29+
@pytest.mark.xfail(
30+
reason="None of these values should be able to instanciate a client object"
31+
)
3032
@pytest.mark.parametrize("url", ["", None, "valeefgpoqwjgpj", 139, -1, {}, []])
3133
@pytest.mark.parametrize("key", ["", None, "valeefgpoqwjgpj", 139, -1, {}, []])
3234
def test_incorrect_values_dont_instanciate_client(url: Any, key: Any) -> None:

tests/test_dummy.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import pytest
2-
3-
41
import supabase_py
52

63
"""
@@ -10,12 +7,10 @@
107
"""
118

129

13-
1410
def test_dummy() -> None:
1511
# Test auth component
1612
assert True == True
1713

1814

19-
2015
def test_client_initialziation() -> None:
2116
client = supabase_py.Client("http://testwebsite.com", "atestapi")

0 commit comments

Comments
 (0)