Skip to content

Commit

Permalink
manual_test_functions: use max_chats parameter; extract constants
Browse files Browse the repository at this point in the history
  • Loading branch information
elliot-100 committed Aug 14, 2024
1 parent 5cc480b commit 4f9a826
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions manual_test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

DUMMY_ID = "DUMMY_ID"

MAX_EVENTS = 10
MAX_CHATS = 10
MAX_TRANSACTIONS = 10


async def main() -> None:
s = spond.Spond(username=username, password=password)
Expand All @@ -27,19 +31,19 @@ async def main() -> None:

# EVENTS

print("\nGetting up to 10 events...")
events = await s.get_events(max_events=10)
print(f"\nGetting up to {MAX_EVENTS} events...")
events = await s.get_events(max_events=MAX_EVENTS)
print(f"{len(events)} events:")
for i, event in enumerate(events):
print(f"[{i}] {_event_summary(event)}")

# MESSAGES
# CHATS (MESSAGES)

print("\nGetting up to 10 messages...")
messages = await s.get_messages()
print(f"{len(messages)} messages:")
for i, message in enumerate(messages):
print(f"[{i}] {_message_summary(message)}")
print(f"\nGetting up to {MAX_CHATS} chats...")
messages = await s.get_messages(max_chats=MAX_CHATS)
print(f"{len(messages)} chats:")
for i, chat in enumerate(messages):
print(f"[{i}] {_message_summary(chat)}")

# ATTENDANCE EXPORT

Expand All @@ -56,8 +60,10 @@ async def main() -> None:

# SPOND CLUB
sc = club.SpondClub(username=username, password=password)
print("\nGetting up to 10 transactions...")
transactions = await sc.get_transactions(club_id=club_id, max_items=10)
print(f"\nGetting up to {MAX_TRANSACTIONS} transactions...")
transactions = await sc.get_transactions(
club_id=club_id, max_items=MAX_TRANSACTIONS
)
print(f"{len(transactions)} transactions:")
for i, t in enumerate(transactions):
print(f"[{i}] {_transaction_summary(t)}")
Expand Down

0 comments on commit 4f9a826

Please sign in to comment.