Skip to content

Commit

Permalink
added integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyagreco committed Sep 17, 2024
1 parent 6895966 commit 74798a9
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 1 deletion.
93 changes: 93 additions & 0 deletions test/integration/test_api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -1644,3 +1644,96 @@
"previous_owner_id": 6,
},
]

# LEAGUE B
LEAGUE_B_LEAGUE_ID = "1002446817038147584"
LEAGUE_B_USERS = [
{
"avatar": "f3b1db9fae71021fde37731161529701",
"display_name": "AlWebz",
"is_bot": False,
"is_owner": False,
"league_id": "1002446817038147584",
"metadata": {"allow_pn": "on", "archived": "off", "mention_pn": "on"},
"settings": None,
"user_id": "729138469988884480",
},
{
"avatar": "5c5c3b22010fc2b2615a1eb147b0e051",
"display_name": "joeyagreco",
"is_bot": False,
"is_owner": True,
"league_id": "1002446817038147584",
"metadata": {
"allow_pn": "on",
"allow_sms": "on",
"archived": "off",
"mascot_item_type_id_leg_10": "jessica",
"mascot_item_type_id_leg_11": "jessica",
"mascot_item_type_id_leg_12": "jessica",
"mascot_item_type_id_leg_13": "jessica",
"mascot_item_type_id_leg_14": "jessica",
"mascot_item_type_id_leg_15": "jessica",
"mascot_item_type_id_leg_16": "jessica",
"mascot_item_type_id_leg_17": "jessica",
"mascot_item_type_id_leg_18": "jessica",
"mascot_item_type_id_leg_4": "jessica",
"mascot_item_type_id_leg_5": "jessica",
"mascot_item_type_id_leg_6": "jessica",
"mascot_item_type_id_leg_7": "jessica",
"mascot_item_type_id_leg_8": "jessica",
"mascot_item_type_id_leg_9": "jessica",
"mascot_message_emotion_leg_4": "idle",
"mention_pn": "on",
"show_mascots": "on",
"team_name": "miss me w that make shit",
},
"settings": None,
"user_id": "852776903310966784",
},
{
"avatar": "2df0f395f42ba17fdec89accc3b38c8e",
"display_name": "evanheff25",
"is_bot": False,
"is_owner": False,
"league_id": "1002446817038147584",
"metadata": {"allow_pn": "on", "mention_pn": "on"},
"settings": None,
"user_id": "861082899649261568",
},
{
"avatar": "b3338675f635c2c1f42b469621d38ec6",
"display_name": "mrdingleberry",
"is_bot": False,
"is_owner": False,
"league_id": "1002446817038147584",
"metadata": {"allow_pn": "on", "mention_pn": "on"},
"settings": None,
"user_id": "862555482408194048",
},
{
"avatar": "82aec8e811b839b8ec25d7b458afd57b",
"display_name": "psnodgrass",
"is_bot": False,
"is_owner": False,
"league_id": "1002446817038147584",
"metadata": {
"allow_pn": "on",
"avatar": "https://sleepercdn.com/uploads/129537b5d2022d40ca18bc46c4596ebf.jpg",
"mention_pn": "on",
"team_name": "Fat Randy’s missers",
},
"settings": None,
"user_id": "862871829390409728",
},
{
"avatar": "82aec8e811b839b8ec25d7b458afd57b",
"display_name": "RickyJ49",
"is_bot": False,
"is_owner": False,
"league_id": "1002446817038147584",
"metadata": {"allow_pn": "on", "mention_pn": "on"},
"settings": None,
"user_id": "869382250104578048",
},
]
13 changes: 12 additions & 1 deletion test/integration/test_api/test_league.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import unittest

from sleeper.api.league import get_league, get_rosters, get_user_leagues_for_year
from sleeper.api.league import (
get_league,
get_rosters,
get_user_leagues_for_year,
get_users_in_league,
)
from sleeper.enum import Sport
from test.integration.test_api.constants import (
LEAGUE_A_LEAGUE_1,
LEAGUE_A_LEAGUE_ID_1,
LEAGUE_B_LEAGUE_ID,
LEAGUE_B_USERS,
USER_A_LEAGUES_2022,
USER_A_USER_ID,
)
Expand All @@ -28,3 +35,7 @@ def test_get_rosters(self):
self.assertEqual(6, len(response))
for item in response:
self.assertIsInstance(item, dict)

def test_get_users_in_league(self):
response = get_users_in_league(league_id=LEAGUE_B_LEAGUE_ID)
self.assertEqual(LEAGUE_B_USERS, response)

0 comments on commit 74798a9

Please sign in to comment.