Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add realtime sync test #922

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion tests/test_realtime_configuration.py → tests/test_realtime.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import supabase


def test_functions_client_initialization() -> None:
def test_realtime_client_initialization() -> None:
ref = "ooqqmozurnggtljmjkii"
url = f"https://{ref}.supabase.co"
# Sample JWT Key
Expand All @@ -12,3 +12,16 @@ def test_functions_client_initialization() -> None:
url = "http://localhost:54322"
sp_local = supabase.Client(url, key)
assert sp_local.realtime_url == f"ws://localhost:54322/realtime/v1"


def test_sync_realtime():
ref = "ooqqmozurnggtljmjkii"
url = f"https://{ref}.supabase.co"
# Sample JWT Key
key = "xxxxxxxxxxxxxx.xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxx"
sp = supabase.Client(url, key)

try:
channel = sp.realtime.channel("test")
except NotImplementedError:
pass
Loading