Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshinishio committed Dec 10, 2024
1 parent f2829e0 commit b77f8a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ def get_env_var(name: str) -> str:
EXCEPTION_OWNERS = ["gitautoai", "hiroshinishio"]
OWNER_TYPE = "Organization"
TEST_EMAIL = "test@gitauto.ai"
UNIQUE_ISSUE_ID = "O/gitautoai/test#1"
TEST_REPO_NAME = "test-repo"
USER_ID = -1
USER_NAME = "username-test"
17 changes: 8 additions & 9 deletions tests/services/supabase/test_users_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
USER_ID,
USER_NAME,
INSTALLATION_ID,
UNIQUE_ISSUE_ID,
NEW_INSTALLATION_ID,
TEST_EMAIL,
TEST_REPO_NAME,
)
from services.stripe.customer import get_subscription
from services.supabase import SupabaseManager
Expand Down Expand Up @@ -102,19 +102,18 @@ def test_how_many_requests_left() -> None:
assert request_count == 5
assert isinstance(end_date, datetime.datetime)

supabase_manager.client.table("issues").insert(
json={
"installation_id": INSTALLATION_ID,
"unique_id": UNIQUE_ISSUE_ID,
}
).execute()
for _ in range(1, 6):
# Generate 5 issues and 5 usage records
for i in range(1, 6):
unique_issue_id: str = f"{OWNER_TYPE}/{OWNER_NAME}/{TEST_REPO_NAME}#{i}"
supabase_manager.client.table("issues").insert(
json={"installation_id": INSTALLATION_ID, "unique_id": unique_issue_id}
).execute()
supabase_manager.client.table("usage").insert(
json={
"user_id": USER_ID,
"installation_id": INSTALLATION_ID,
"is_completed": True,
"unique_issue_id": UNIQUE_ISSUE_ID,
"unique_issue_id": unique_issue_id,
}
).execute()

Expand Down

0 comments on commit b77f8a4

Please sign in to comment.