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

GitAuto: Add an integration test for get_graphql_client in services/github/graphql_client.py #564

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions tests/integration/test_graphql_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pytest
from gql import Client
from services.github.graphql_client import get_graphql_client
from tests.constants import TOKEN


def test_get_graphql_client_integration():
"""
Integration test for get_graphql_client

This test creates a GraphQL client for the GitHub API using the token from
tests/constants.py. It verifies that the client is an instance of gql.Client.

For more details, refer to the GitHub GraphQL API docs: https://docs.github.com/en/graphql
"""
client = get_graphql_client(TOKEN)
assert isinstance(client, Client)
4 changes: 2 additions & 2 deletions tests/services/supabase/test_users_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ async def test_install_uninstall_install() -> None:
.eq(column="owner_id", value=OWNER_ID)
.execute()
)
assert owners_data[1][0]["owner_id"] == OWNER_ID
assert isinstance(owners_data[1][0]["stripe_customer_id"], str)
assert owners_data[0]["owner_id"] == OWNER_ID
assert isinstance(owners_data[0]["stripe_customer_id"], str)

# Check Installation Record
installation_data, _ = (
Expand Down
Loading