repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoreplayertrackv3 import (
PLAYER_METADATA_FIELDS,
PLAYERTRACK_STATS_FIELDS,
TEAM_METADATA_FIELDS,
NBAStatsBoxscorePlayerTrackV3Parser,
)
from .data.boxscoreplayertrackv3 import BOXSCOREPLAYERTRACKV3_SAMPLE
def json_fixture():
"""Return the ... | 1 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoreplayertrackv3_parser.py | test_parser_with_missing_statistics | TestBoxScorePlayerTrackV3ParserEdgeCases | 419 | null |
swar/nba_api | from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import BoxScoreSummaryV3
from nba_api.stats.endpoints._parsers import NBAStatsBoxscoreSummaryParserV3
from .data.boxscoresummaryv3 import BOXSCORESUMMARYV3_SAMPLE
def json_fixture():
"""Load the BoxScoreSummaryV3 fixture."""
re... | "WI" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoresummaryv3.py | test_get_arena_info_data | TestNBAStatsBoxscoreSummaryParserV3 | 88 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoremiscv3 import (
MISC_STATS_FIELDS,
PLAYER_METADATA_FIELDS,
TEAM_METADATA_FIELDS,
NBAStatsBoxscoreMiscV3Parser,
)
from .data.boxscoremiscv3 import BOXSCOREMISCV3_SAMPLE
def json_fixture():
"""Return the boxscoremiscv3 sample fixture."""
... | "gameId" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoremiscv3_parser.py | test_team_headers_structure | TestBoxscoreMiscV3Parser | 36 | null |
swar/nba_api | from nba_api.stats.endpoints import TeamGameLogs
class TestTeamGameLogsInitialization:
def test_conference_and_division_filters(self):
"""Test conference and division filtering parameters."""
endpoint = TeamGameLogs(
vs_conference_nullable="East",
vs_division_nullable="Atla... | "East" | assert | string_literal | tests/unit/stats/endpoints/test_teamgamelogs.py | test_conference_and_division_filters | TestTeamGameLogsInitialization | 53 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoreplayertrackv3 import (
PLAYER_METADATA_FIELDS,
PLAYERTRACK_STATS_FIELDS,
TEAM_METADATA_FIELDS,
NBAStatsBoxscorePlayerTrackV3Parser,
)
from .data.boxscoreplayertrackv3 import BOXSCOREPLAYERTRACKV3_SAMPLE
def json_fixture():
"""Return the ... | 5 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoreplayertrackv3_parser.py | test_team_metadata_fields | TestBoxScorePlayerTrackV3ParserConstants | 31 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.scoreboardv3 import (
NBAStatsScoreboardV3Parser,
)
from .data.scoreboardv3 import SCOREBOARDV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsScoreboardV3Parser(SCOREBOARDV3_SAMPLE)
def json_fixture():
... | "home" | assert | string_literal | tests/unit/stats/endpoints/test_scoreboardv3_parser.py | test_get_game_leaders_data | TestNBAStatsScoreboardV3Parser | 143 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscorematchupsv3 import (
NBAStatsBoxscoreMatchupsParserV3,
)
def json_fixture():
"""Load the BoxScoreMatchupsV3 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_a... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscorematchupsv3_parser.py | test_get_players_headers_returns_list | TestNBAStatsBoxscoreMatchupsParserV3 | 51 | null |
swar/nba_api | import json
import pytest
from nba_api.library.http import NBAHTTP, NBAResponse
from nba_api.live.nba.endpoints import boxscore
from nba_api.live.nba.library.http import NBALiveHTTP
content = {
"meta": {
"version": 1,
"code": 200,
"request": "http://nba.cloud/games/0022000180/boxscore?For... | content["game"] | assert | complex_expr | tests/unit/live/endpoints/test_live_boxscore.py | test_game_dict | 505 | null | |
swar/nba_api | from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import BoxScoreSummaryV3
from nba_api.stats.endpoints._parsers import NBAStatsBoxscoreSummaryParserV3
from .data.boxscoresummaryv3 import BOXSCORESUMMARYV3_SAMPLE
def json_fixture():
"""Load the BoxScoreSummaryV3 fixture."""
re... | 5 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoresummaryv3.py | test_get_last_five_meetings_data | TestNBAStatsBoxscoreSummaryParserV3 | 162 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoreadvancedv3 import (
NBAStatsBoxscoreAdvancedV3Parser,
)
from .data.boxscoreadvancedv3 import BOXSCOREADVANCEDV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsBox... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoreadvancedv3_parser.py | test_parser_with_full_response | TestNBAStatsBoxscoreAdvancedV3Parser | 184 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.gravityleaders import (
NBAStatsGravityLeadersParser,
)
from .data.gravityleaders import (
GRAVITYLEADERS_EMPTY,
GRAVITYLEADERS_INVALID_LEADERS_TYPE,
GRAVITYLEADERS_MISSING_LEADERS,
GRAVITYLEADERS_MIXED_VALID_INVALID,
GRAVITYLEADERS_PARTIAL_F... | [] | assert | collection | tests/unit/stats/endpoints/test_gravityleaders_parser.py | test_empty_leaders_list | TestGravityLeadersParserEdgeCases | 162 | null |
swar/nba_api | import json
import pytest
from nba_api.library.http import NBAHTTP, NBAResponse
from nba_api.live.nba.endpoints import playbyplay
from nba_api.live.nba.library.http import NBALiveHTTP
content = {
"meta": {
"version": 1,
"code": 200,
"request": "http://nba.cloud/games/0022000180/playbyplay... | actions | assert | variable | tests/unit/live/endpoints/test_live_playbyplay.py | test_get_actions_dict | 127 | null | |
swar/nba_api | import re
from nba_api.stats.library.parameters import (
Season,
SeasonType,
SeasonTypeAllStar,
SeasonTypeAllStarNullable,
SeasonTypeNullable,
SeasonTypePlayoffs,
_NotRequired,
)
def test_season_type_base():
assert SeasonType.regular == "Regular Season"
assert SeasonType.preseason ... | "PlayIn" | assert | string_literal | tests/unit/stats/library/test_parameters.py | test_season_type_base | 21 | null | |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscorematchupsv3 import (
NBAStatsBoxscoreMatchupsParserV3,
)
def json_fixture():
"""Load the BoxScoreMatchupsV3 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_a... | headers | assert | variable | tests/unit/stats/endpoints/test_boxscorematchupsv3_parser.py | test_get_players_headers_structure | TestNBAStatsBoxscoreMatchupsParserV3 | 58 | null |
swar/nba_api | from typing import Any
from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import DunkScoreLeaders
from .data.dunkscoreleaders import DUNKSCORELEADERS_SAMPLE
def json_fixture() -> dict[str, Any]:
"""Load the DunkScoreLeaders fixture."""
return DUNKSCORELEADERS_SAMPLE
class Test... | "1630168" | assert | string_literal | tests/unit/stats/endpoints/test_dunkscoreleaders.py | test_endpoint_initialization_with_filters | TestDunkScoreLeadersEndpoint | 40 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoreusagev3 import (
NBAStatsBoxscoreUsageV3Parser,
)
from .data.boxscoreusagev3 import BOXSCOREUSAGEV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsBoxscoreUsageV3Parser(BOXSCOREUSAGEV3_SAMPLE)
def js... | "MIN" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoreusagev3_parser.py | test_get_team_data | TestNBAStatsBoxscoreUsageV3Parser | 121 | null |
swar/nba_api | import warnings
from nba_api.stats.endpoints import LeagueGameFinder
class TestLeagueGameFinderInitialization:
def test_endpoint_initialization_without_request(self):
"""Test endpoint initializes without making HTTP request."""
endpoint = LeagueGameFinder(
player_or_team_abbreviation=... | "2023-24" | assert | string_literal | tests/unit/stats/endpoints/test_leaguegamefinder.py | test_endpoint_initialization_without_request | TestLeagueGameFinderInitialization | 72 | null |
swar/nba_api | import pytest
from nba_api.stats.library.playbyplayregex import (
re_block,
re_ejection,
re_field_goal_made,
re_field_goal_missed,
re_foul_player,
re_foul_team,
re_free_throw_made,
re_free_throw_miss,
re_jump_ball,
re_rebound_player,
re_rebound_team,
re_steal,
re_sub... | play["full"] | assert | complex_expr | tests/unit/stats/library/test_playbyplayregex.py | test_timeout | 328 | null | |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscorehustlev2 import (
NBAStatsBoxscoreHustleV2Parser,
)
def json_fixture():
"""Load the BoxScoreHustleV2 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_api"
... | 2 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscorehustlev2_parser.py | test_get_team_data | TestNBAStatsBoxscoreHustleV2Parser | 97 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscorehustlev2 import (
NBAStatsBoxscoreHustleV2Parser,
)
def json_fixture():
"""Load the BoxScoreHustleV2 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_api"
... | 31 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscorehustlev2_parser.py | test_get_player_headers | TestNBAStatsBoxscoreHustleV2Parser | 78 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoreadvancedv3 import (
NBAStatsBoxscoreAdvancedV3Parser,
)
from .data.boxscoreadvancedv3 import BOXSCOREADVANCEDV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsBox... | "Sun" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoreadvancedv3_parser.py | test_get_team_data | TestNBAStatsBoxscoreAdvancedV3Parser | 98 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.playbyplayv3 import NBAStatsPlayByPlayParserV3
from .data.playbyplayv3 import (
PLAYBYPLAYV3_EMPTY,
PLAYBYPLAYV3_MINIMAL,
PLAYBYPLAYV3_SAMPLE,
)
def parser():
"""Create parser with sample data."""
return NBAStatsPlayByPlayParserV3(PLAYBYPLAYV3_S... | result | assert | variable | tests/unit/stats/endpoints/test_playbyplayv3_parser.py | test_get_data_sets | TestNBAStatsPlayByPlayParserV3 | 121 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscorescoringv3 import (
NBAStatsBoxscoreScoringV3Parser,
)
from .data.boxscorescoringv3 import BOXSCORESCORINGV3_SAMPLE
def json_fixture():
"""Return the BoxScoreScoringV3 sample fixture."""
return BOXSCORESCORINGV3_SAMPLE
class TestBoxscoreScoringV... | headers | assert | variable | tests/unit/stats/endpoints/test_boxscorescoringv3_parser.py | test_get_team_headers | TestBoxscoreScoringV3Parser | 35 | null |
swar/nba_api | from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import ScheduleLeagueV2
from nba_api.stats.endpoints._parsers import NBAStatsScheduleLeagueV2Parser
from .data.scheduleleaguev2 import (
SCHEDULELEAGUEV2_2015_16,
SCHEDULELEAGUEV2_2020_21,
)
def json_fixture_2020():
"""Get ... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_scheduleleaguev2.py | test_get_weeks_data_2020 | TestNBAStatsScheduleLeagueV2Parser | 83 | null |
swar/nba_api | import pytest
from tests.integration.helpers.constants import GAME_ID, PLAYER_ID
from tests.integration.helpers.models import EndpointSpec
def test_endpoint_spec_auto_resolves_required_params():
endpoint = EndpointSpec(DemoEndpoint)()
assert endpoint.game_id == GAME_ID
assert endpoint.player_id == | PLAYER_ID | assert | variable | tests/unit/integration/helpers/test_endpoint_spec.py | test_endpoint_spec_auto_resolves_required_params | 37 | null | |
swar/nba_api | from typing import Any
from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import TeamDashLineups
from .data.teamdashlineups import TEAMDASHLINEUPS_SAMPLE
def json_fixture() -> dict[str, Any]:
"""Load the TeamDashLineups fixture."""
return TEAMDASHLINEUPS_SAMPLE
class TestTeamD... | "Base" | assert | string_literal | tests/unit/stats/endpoints/test_teamdashlineups.py | test_endpoint_initialization_with_filters | TestTeamDashLineupsEndpoint | 50 | null |
swar/nba_api | import pytest
from nba_api.stats.library.playbyplayregex import (
re_block,
re_ejection,
re_field_goal_made,
re_field_goal_missed,
re_foul_player,
re_foul_team,
re_free_throw_made,
re_free_throw_miss,
re_jump_ball,
re_rebound_player,
re_rebound_team,
re_steal,
re_sub... | play["points"] | assert | complex_expr | tests/unit/stats/library/test_playbyplayregex.py | test_field_goal_made | 86 | null | |
swar/nba_api | from unittest.mock import Mock, patch
from nba_api.stats.endpoints import ScoreboardV3
from nba_api.stats.endpoints._parsers.scoreboardv3 import (
NBAStatsScoreboardV3Parser,
)
from .data.scoreboardv3 import SCOREBOARDV3_SAMPLE
class TestScoreboardV3Endpoint:
def test_endpoint_initialization_with_custom_lea... | "10" | assert | string_literal | tests/unit/stats/endpoints/test_scoreboardv3.py | test_endpoint_initialization_with_custom_league | TestScoreboardV3Endpoint | 31 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.iststandings import (
NBAStatsISTStandingsParser,
)
def json_fixture():
"""Load the ISTStandings JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_api"
/ "sta... | result | assert | variable | tests/unit/stats/endpoints/test_iststandings_parser.py | test_get_data_sets | TestNBAStatsISTStandingsParser | 97 | null |
swar/nba_api | import warnings
from nba_api.stats.library.eventmsgtype import EventMsgType
def test_eventmsgtype():
with warnings.catch_warnings(record=True) as w:
# Invoke Deprecation Warning
_ = EventMsgType.UNKNOWN
assert len(w) == | 1 | assert | numeric_literal | tests/unit/stats/library/test_eventmsgtype.py | test_eventmsgtype | 11 | null | |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoremiscv3 import (
MISC_STATS_FIELDS,
PLAYER_METADATA_FIELDS,
TEAM_METADATA_FIELDS,
NBAStatsBoxscoreMiscV3Parser,
)
from .data.boxscoremiscv3 import BOXSCOREMISCV3_SAMPLE
def json_fixture():
"""Return the boxscoremiscv3 sample fixture."""
... | 21 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoremiscv3_parser.py | test_team_statistics_values | TestBoxscoreMiscV3Parser | 191 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.gravityleaders import (
NBAStatsGravityLeadersParser,
)
from .data.gravityleaders import (
GRAVITYLEADERS_EMPTY,
GRAVITYLEADERS_INVALID_LEADERS_TYPE,
GRAVITYLEADERS_MISSING_LEADERS,
GRAVITYLEADERS_MIXED_VALID_INVALID,
GRAVITYLEADERS_PARTIAL_F... | 2 | assert | numeric_literal | tests/unit/stats/endpoints/test_gravityleaders_parser.py | test_mixed_valid_invalid_entries | TestGravityLeadersParserEdgeCases | 201 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoreadvancedv3 import (
NBAStatsBoxscoreAdvancedV3Parser,
)
from .data.boxscoreadvancedv3 import BOXSCOREADVANCEDV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsBox... | "sun" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoreadvancedv3_parser.py | test_get_team_data | TestNBAStatsBoxscoreAdvancedV3Parser | 100 | null |
swar/nba_api | import json
import pytest
from nba_api.library.http import NBAHTTP, NBAResponse
from nba_api.live.nba.endpoints import boxscore
from nba_api.live.nba.library.http import NBALiveHTTP
content = {
"meta": {
"version": 1,
"code": 200,
"request": "http://nba.cloud/games/0022000180/boxscore?For... | content | assert | variable | tests/unit/live/endpoints/test_live_boxscore.py | test_get_dict | 501 | null | |
swar/nba_api | import json
import pytest
from nba_api.library.http import NBAHTTP, NBAResponse
from nba_api.live.nba.endpoints import odds
from nba_api.live.nba.library.http import NBALiveHTTP
content = {
"games": [
{
"gameId": "0022400913",
"sr_id": "sr:match:52632103",
"srMatchId":... | proxy_url | assert | variable | tests/unit/live/endpoints/test_live_odds.py | test_initialization_with_proxy | 466 | null | |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoredefensivev2 import (
NBAStatsBoxscoreDefensiveV2Parser,
)
from .data.boxscoredefensivev2 import BOXSCOREDEFENSIVEV2_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStat... | 2 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoredefensivev2_parser.py | test_get_team_data | TestNBAStatsBoxscoreDefensiveV2Parser | 94 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoretraditionalv3 import (
NBAStatsBoxscoreTraditionalParserV3,
)
from .data.boxscoretraditionalv3 import BOXSCORETRADITIONALV3_SAMPLE
def parser():
"""Create a parser instance with the JSON fixture."""
return NBAStatsBoxscoreTraditionalParserV3(BOX... | 4 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoretraditionalv3_parser.py | test_get_start_bench_data | TestNBAStatsBoxscoreTraditionalParserV3 | 128 | null |
swar/nba_api | import warnings
from nba_api.stats.endpoints import LeagueGameFinder
class TestLeagueGameFinderWarnings:
def test_no_warning_without_game_id(self):
"""Test that NOT using game_id_nullable does not emit a warning."""
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_leaguegamefinder.py | test_no_warning_without_game_id | TestLeagueGameFinderWarnings | 42 | null |
swar/nba_api | import re
from nba_api.stats.library.parameters import (
Season,
SeasonType,
SeasonTypeAllStar,
SeasonTypeAllStarNullable,
SeasonTypeNullable,
SeasonTypePlayoffs,
_NotRequired,
)
def test_season_type_playoffs():
assert SeasonTypePlayoffs.regular == "Regular Season"
assert SeasonTyp... | "Playoffs" | assert | string_literal | tests/unit/stats/library/test_parameters.py | test_season_type_playoffs | 33 | null | |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoredefensivev2 import (
NBAStatsBoxscoreDefensiveV2Parser,
)
from .data.boxscoredefensivev2 import BOXSCOREDEFENSIVEV2_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStat... | "123" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoredefensivev2_parser.py | test_handles_missing_fields | TestNBAStatsBoxscoreDefensiveV2Parser | 175 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscorehustlev2 import (
NBAStatsBoxscoreHustleV2Parser,
)
def json_fixture():
"""Load the BoxScoreHustleV2 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_api"
... | headers | assert | variable | tests/unit/stats/endpoints/test_boxscorehustlev2_parser.py | test_get_team_headers | TestNBAStatsBoxscoreHustleV2Parser | 63 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.scoreboardv3 import (
NBAStatsScoreboardV3Parser,
)
from .data.scoreboardv3 import SCOREBOARDV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsScoreboardV3Parser(SCOREBOARDV3_SAMPLE)
def json_fixture():
... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_scoreboardv3_parser.py | test_get_broadcasters_data | TestNBAStatsScoreboardV3Parser | 193 | null |
swar/nba_api | from typing import Any
from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import DunkScoreLeaders
from .data.dunkscoreleaders import DUNKSCORELEADERS_SAMPLE
def json_fixture() -> dict[str, Any]:
"""Load the DunkScoreLeaders fixture."""
return DUNKSCORELEADERS_SAMPLE
class Test... | "2024-25" | assert | string_literal | tests/unit/stats/endpoints/test_dunkscoreleaders.py | test_endpoint_initialization_without_request | TestDunkScoreLeadersEndpoint | 26 | null |
swar/nba_api | from typing import Any
from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import TeamDashLineups
from .data.teamdashlineups import TEAMDASHLINEUPS_SAMPLE
def json_fixture() -> dict[str, Any]:
"""Load the TeamDashLineups fixture."""
return TEAMDASHLINEUPS_SAMPLE
class TestTeamD... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_teamdashlineups.py | test_optional_parameters_defaults | TestTeamDashLineupsEndpoint | 243 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscorehustlev2 import (
NBAStatsBoxscoreHustleV2Parser,
)
def json_fixture():
"""Load the BoxScoreHustleV2 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_api"
... | 23 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscorehustlev2_parser.py | test_get_team_headers | TestNBAStatsBoxscoreHustleV2Parser | 53 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.scheduleleaguev2 import (
NBAStatsScheduleLeagueV2Parser,
)
def json_fixture():
"""Load the ScheduleLeagueV2 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_api"
... | keys | assert | variable | tests/unit/stats/endpoints/test_scheduleleaguev2_parser.py | test_get_points_leaders_keys | TestNBAStatsScheduleLeagueV2Parser | 204 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.scoreboardv3 import (
NBAStatsScoreboardV3Parser,
)
from .data.scoreboardv3 import SCOREBOARDV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsScoreboardV3Parser(SCOREBOARDV3_SAMPLE)
def json_fixture():
... | "00" | assert | string_literal | tests/unit/stats/endpoints/test_scoreboardv3_parser.py | test_get_scoreboard_info_data | TestNBAStatsScoreboardV3Parser | 47 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoredefensivev2 import (
NBAStatsBoxscoreDefensiveV2Parser,
)
from .data.boxscoredefensivev2 import BOXSCOREDEFENSIVEV2_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStat... | "Sun" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoredefensivev2_parser.py | test_get_team_data | TestNBAStatsBoxscoreDefensiveV2Parser | 101 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoreplayertrackv3 import (
PLAYER_METADATA_FIELDS,
PLAYERTRACK_STATS_FIELDS,
TEAM_METADATA_FIELDS,
NBAStatsBoxscorePlayerTrackV3Parser,
)
from .data.boxscoreplayertrackv3 import BOXSCOREPLAYERTRACKV3_SAMPLE
def json_fixture():
"""Return the ... | "gameId" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoreplayertrackv3_parser.py | test_get_team_headers | TestBoxScorePlayerTrackV3ParserHeaders | 104 | null |
swar/nba_api | from unittest.mock import Mock, patch
from nba_api.stats.endpoints import CommonTeamRoster
class TestCommonTeamRosterEndpoint:
def test_expected_data_structure(self):
"""Test that expected_data has both required datasets."""
assert "Coaches" in | CommonTeamRoster.expected_data | assert | complex_expr | tests/unit/stats/endpoints/test_commonteamroster.py | test_expected_data_structure | TestCommonTeamRosterEndpoint | 94 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.playbyplayv3 import NBAStatsPlayByPlayParserV3
from .data.playbyplayv3 import (
PLAYBYPLAYV3_EMPTY,
PLAYBYPLAYV3_MINIMAL,
PLAYBYPLAYV3_SAMPLE,
)
def parser():
"""Create parser with sample data."""
return NBAStatsPlayByPlayParserV3(PLAYBYPLAYV3_S... | data_sets | assert | variable | tests/unit/stats/endpoints/test_playbyplayv3_parser.py | test_handles_missing_meta | TestNBAStatsPlayByPlayParserV3 | 134 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoremiscv3 import (
MISC_STATS_FIELDS,
PLAYER_METADATA_FIELDS,
TEAM_METADATA_FIELDS,
NBAStatsBoxscoreMiscV3Parser,
)
from .data.boxscoremiscv3 import BOXSCOREMISCV3_SAMPLE
def json_fixture():
"""Return the boxscoremiscv3 sample fixture."""
... | field | assert | variable | tests/unit/stats/endpoints/test_boxscoremiscv3_parser.py | test_team_headers_structure | TestBoxscoreMiscV3Parser | 40 | null |
swar/nba_api | from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import ScheduleLeagueV2
from nba_api.stats.endpoints._parsers import NBAStatsScheduleLeagueV2Parser
from .data.scheduleleaguev2 import (
SCHEDULELEAGUEV2_2015_16,
SCHEDULELEAGUEV2_2020_21,
)
def json_fixture_2020():
"""Get ... | [] | assert | collection | tests/unit/stats/endpoints/test_scheduleleaguev2.py | test_get_data_sets_2015 | TestNBAStatsScheduleLeagueV2Parser | 157 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.gravityleaders import (
NBAStatsGravityLeadersParser,
)
from .data.gravityleaders import (
GRAVITYLEADERS_EMPTY,
GRAVITYLEADERS_INVALID_LEADERS_TYPE,
GRAVITYLEADERS_MISSING_LEADERS,
GRAVITYLEADERS_MIXED_VALID_INVALID,
GRAVITYLEADERS_PARTIAL_F... | {} | assert | collection | tests/unit/stats/endpoints/test_gravityleaders_parser.py | test_none_input | TestGravityLeadersParserEdgeCases | 181 | null |
swar/nba_api | import warnings
from nba_api.stats.endpoints import LeagueGameFinder
class TestLeagueGameFinderWarnings:
def test_game_id_nullable_emits_warning(self):
"""Test that using game_id_nullable parameter emits a warning."""
with warnings.catch_warnings(record=True) as w:
warnings.simplefilt... | 1 | assert | numeric_literal | tests/unit/stats/endpoints/test_leaguegamefinder.py | test_game_id_nullable_emits_warning | TestLeagueGameFinderWarnings | 24 | null |
swar/nba_api | from typing import Any
from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import DunkScoreLeaders
from .data.dunkscoreleaders import DUNKSCORELEADERS_SAMPLE
def json_fixture() -> dict[str, Any]:
"""Load the DunkScoreLeaders fixture."""
return DUNKSCORELEADERS_SAMPLE
class Test... | None | assert | none_literal | tests/unit/stats/endpoints/test_dunkscoreleaders.py | test_endpoint_with_mocked_request | TestDunkScoreLeadersEndpoint | 101 | null |
swar/nba_api | from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import ScheduleLeagueV2
from nba_api.stats.endpoints._parsers import NBAStatsScheduleLeagueV2Parser
from .data.scheduleleaguev2 import (
SCHEDULELEAGUEV2_2015_16,
SCHEDULELEAGUEV2_2020_21,
)
def json_fixture_2020():
"""Get ... | headers | assert | variable | tests/unit/stats/endpoints/test_scheduleleaguev2.py | test_get_weeks_headers_2020 | TestNBAStatsScheduleLeagueV2Parser | 56 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.playbyplayv3 import NBAStatsPlayByPlayParserV3
from .data.playbyplayv3 import (
PLAYBYPLAYV3_EMPTY,
PLAYBYPLAYV3_MINIMAL,
PLAYBYPLAYV3_SAMPLE,
)
def parser():
"""Create parser with sample data."""
return NBAStatsPlayByPlayParserV3(PLAYBYPLAYV3_S... | 2 | assert | numeric_literal | tests/unit/stats/endpoints/test_playbyplayv3_parser.py | test_get_playbyplay_data | TestNBAStatsPlayByPlayParserV3 | 89 | null |
swar/nba_api | from typing import Any
from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import DunkScoreLeaders
from .data.dunkscoreleaders import DUNKSCORELEADERS_SAMPLE
def json_fixture() -> dict[str, Any]:
"""Load the DunkScoreLeaders fixture."""
return DUNKSCORELEADERS_SAMPLE
class Test... | params | assert | variable | tests/unit/stats/endpoints/test_dunkscoreleaders.py | test_json_fixture_structure | TestDunkScoreLeadersEndpoint | 116 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoreplayertrackv3 import (
PLAYER_METADATA_FIELDS,
PLAYERTRACK_STATS_FIELDS,
TEAM_METADATA_FIELDS,
NBAStatsBoxscorePlayerTrackV3Parser,
)
from .data.boxscoreplayertrackv3 import BOXSCOREPLAYERTRACKV3_SAMPLE
def json_fixture():
"""Return the ... | "26:29" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoreplayertrackv3_parser.py | test_parser_with_missing_statistics | TestBoxScorePlayerTrackV3ParserEdgeCases | 421 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscorematchupsv3 import (
NBAStatsBoxscoreMatchupsParserV3,
)
def json_fixture():
"""Load the BoxScoreMatchupsV3 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_a... | result["PlayerStats"] | assert | complex_expr | tests/unit/stats/endpoints/test_boxscorematchupsv3_parser.py | test_get_data_sets | TestNBAStatsBoxscoreMatchupsParserV3 | 79 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoreadvancedv3 import (
NBAStatsBoxscoreAdvancedV3Parser,
)
from .data.boxscoreadvancedv3 import BOXSCOREADVANCEDV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsBox... | "123" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoreadvancedv3_parser.py | test_handles_missing_fields | TestNBAStatsBoxscoreAdvancedV3Parser | 168 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoredefensivev2 import (
NBAStatsBoxscoreDefensiveV2Parser,
)
from .data.boxscoredefensivev2 import BOXSCOREDEFENSIVEV2_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStat... | result | assert | variable | tests/unit/stats/endpoints/test_boxscoredefensivev2_parser.py | test_parser_with_full_response | TestNBAStatsBoxscoreDefensiveV2Parser | 182 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints import TeamGameLog
class TestTeamGameLogInitialization:
def test_required_parameter_team_id(self):
"""Test that team_id is required."""
with pytest.raises( | TypeError) | pytest.raises | variable | tests/unit/stats/endpoints/test_teamgamelog.py | test_required_parameter_team_id | TestTeamGameLogInitialization | 27 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.iststandings import (
NBAStatsISTStandingsParser,
)
def json_fixture():
"""Load the ISTStandings JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_api"
/ "sta... | headers | assert | variable | tests/unit/stats/endpoints/test_iststandings_parser.py | test_get_iststandings_headers_structure | TestNBAStatsISTStandingsParser | 62 | null |
swar/nba_api | import json
import pytest
from nba_api.library.http import NBAHTTP, NBAResponse
from nba_api.live.nba.endpoints import boxscore
from nba_api.live.nba.library.http import NBALiveHTTP
content = {
"meta": {
"version": 1,
"code": 200,
"request": "http://nba.cloud/games/0022000180/boxscore?For... | content["game"]["arena"] | assert | complex_expr | tests/unit/live/endpoints/test_live_boxscore.py | test_arena_dict | 509 | null | |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoredefensivev2 import (
NBAStatsBoxscoreDefensiveV2Parser,
)
from .data.boxscoredefensivev2 import BOXSCOREDEFENSIVEV2_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStat... | "CON" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoredefensivev2_parser.py | test_get_team_data | TestNBAStatsBoxscoreDefensiveV2Parser | 102 | null |
swar/nba_api | from unittest.mock import Mock, patch
from nba_api.stats.endpoints import ScoreboardV3
from nba_api.stats.endpoints._parsers.scoreboardv3 import (
NBAStatsScoreboardV3Parser,
)
from .data.scoreboardv3 import SCOREBOARDV3_SAMPLE
class TestScoreboardV3Endpoint:
def test_expected_data_matches_parser_headers(se... | tuple(_EXPECTED_DATA["GameHeader"]) | assert | func_call | tests/unit/stats/endpoints/test_scoreboardv3.py | test_expected_data_matches_parser_headers | TestScoreboardV3Endpoint | 65 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscorefourfactorsv3 import (
NBAStatsBoxscoreFourFactorsV3Parser,
)
from .data.boxscorefourfactorsv3 import BOXSCOREFOURFACTORSV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return... | result | assert | variable | tests/unit/stats/endpoints/test_boxscorefourfactorsv3_parser.py | test_parser_with_full_response | TestNBAStatsBoxscoreFourFactorsV3Parser | 163 | null |
swar/nba_api | import pytest
from tests.integration.helpers.constants import GAME_ID, PLAYER_ID
from tests.integration.helpers.models import EndpointSpec
def test_endpoint_spec_overrides_win_for_required_and_optional_params():
endpoint = EndpointSpec(
DemoEndpoint,
game_id="0022300001",
player_id="201939... | "201939" | assert | string_literal | tests/unit/integration/helpers/test_endpoint_spec.py | test_endpoint_spec_overrides_win_for_required_and_optional_params | 50 | null | |
swar/nba_api | import json
import logging
import re
logger = logging.getLogger(__name__)
def to_snake_case(name):
"""Convert PascalCase or camelCase to snake_case."""
s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name)
s2 = re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1)
return s2.lower()
def _count_dataset_rows(endpoint):
... | None | assert | none_literal | tests/integration/scenarios/helpers.py | assert_endpoint_instantiates | 221 | null | |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.scheduleleaguev2 import (
NBAStatsScheduleLeagueV2Parser,
)
def json_fixture():
"""Load the ScheduleLeagueV2 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_api"
... | result | assert | variable | tests/unit/stats/endpoints/test_scheduleleaguev2_parser.py | test_get_data_sets | TestNBAStatsScheduleLeagueV2Parser | 50 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.playbyplayv3 import NBAStatsPlayByPlayParserV3
from .data.playbyplayv3 import (
PLAYBYPLAYV3_EMPTY,
PLAYBYPLAYV3_MINIMAL,
PLAYBYPLAYV3_SAMPLE,
)
def parser():
"""Create parser with sample data."""
return NBAStatsPlayByPlayParserV3(PLAYBYPLAYV3_S... | "gameId" | assert | string_literal | tests/unit/stats/endpoints/test_playbyplayv3_parser.py | test_get_playbyplay_headers | TestNBAStatsPlayByPlayParserV3 | 48 | null |
swar/nba_api | from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import ScheduleLeagueV2
from nba_api.stats.endpoints._parsers import NBAStatsScheduleLeagueV2Parser
from .data.scheduleleaguev2 import (
SCHEDULELEAGUEV2_2015_16,
SCHEDULELEAGUEV2_2020_21,
)
def json_fixture_2020():
"""Get ... | "00" | assert | string_literal | tests/unit/stats/endpoints/test_scheduleleaguev2.py | test_get_weeks_data_2020 | TestNBAStatsScheduleLeagueV2Parser | 85 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoremiscv3 import (
MISC_STATS_FIELDS,
PLAYER_METADATA_FIELDS,
TEAM_METADATA_FIELDS,
NBAStatsBoxscoreMiscV3Parser,
)
from .data.boxscoremiscv3 import BOXSCOREMISCV3_SAMPLE
def json_fixture():
"""Return the boxscoremiscv3 sample fixture."""
... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoremiscv3_parser.py | test_player_stats_extracted | TestBoxscoreMiscV3Parser | 147 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoremiscv3 import (
MISC_STATS_FIELDS,
PLAYER_METADATA_FIELDS,
TEAM_METADATA_FIELDS,
NBAStatsBoxscoreMiscV3Parser,
)
from .data.boxscoremiscv3 import BOXSCOREMISCV3_SAMPLE
def json_fixture():
"""Return the boxscoremiscv3 sample fixture."""
... | "240:00" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoremiscv3_parser.py | test_team_statistics_values | TestBoxscoreMiscV3Parser | 189 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.playbyplayv3 import NBAStatsPlayByPlayParserV3
from .data.playbyplayv3 import (
PLAYBYPLAYV3_EMPTY,
PLAYBYPLAYV3_MINIMAL,
PLAYBYPLAYV3_SAMPLE,
)
def parser():
"""Create parser with sample data."""
return NBAStatsPlayByPlayParserV3(PLAYBYPLAYV3_S... | headers | assert | variable | tests/unit/stats/endpoints/test_playbyplayv3_parser.py | test_get_playbyplay_headers | TestNBAStatsPlayByPlayParserV3 | 79 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscorematchupsv3 import (
NBAStatsBoxscoreMatchupsParserV3,
)
def json_fixture():
"""Load the BoxScoreMatchupsV3 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_a... | game_id | assert | variable | tests/unit/stats/endpoints/test_boxscorematchupsv3_parser.py | test_game_id_in_all_rows | TestNBAStatsBoxscoreMatchupsParserV3 | 130 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscorescoringv3 import (
NBAStatsBoxscoreScoringV3Parser,
)
from .data.boxscorescoringv3 import BOXSCORESCORINGV3_SAMPLE
def json_fixture():
"""Return the BoxScoreScoringV3 sample fixture."""
return BOXSCORESCORINGV3_SAMPLE
class TestBoxscoreScoringV... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscorescoringv3_parser.py | test_parser_with_missing_players | TestBoxscoreScoringV3Parser | 266 | null |
swar/nba_api | from unittest.mock import Mock, patch
from nba_api.stats.endpoints import CommonTeamRoster
class TestCommonTeamRosterEndpoint:
@patch("nba_api.stats.endpoints.commonteamroster.NBAStatsHTTP.send_api_request")
def test_endpoint_with_both_datasets(self, mock_request):
"""Test endpoint processes response... | None | assert | none_literal | tests/unit/stats/endpoints/test_commonteamroster.py | test_endpoint_with_both_datasets | TestCommonTeamRosterEndpoint | 46 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoredefensivev2 import (
NBAStatsBoxscoreDefensiveV2Parser,
)
from .data.boxscoredefensivev2 import BOXSCOREDEFENSIVEV2_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStat... | "7:13" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoredefensivev2_parser.py | test_get_player_data | TestNBAStatsBoxscoreDefensiveV2Parser | 124 | null |
swar/nba_api | from contextlib import suppress
from unittest.mock import Mock
import pytest
import requests
from nba_api.library.http import NBAHTTP
from nba_api.stats.endpoints import AllTimeLeadersGrids
def mock_session():
session = Mock(spec=requests.Session)
# Mock the get method to return a response-like object
mo... | None | assert | none_literal | tests/unit/http/test_http.py | test_nbahttp_session_management | 25 | null | |
swar/nba_api | from nba_api.stats.endpoints import TeamGameLogs
class TestTeamGameLogsInitialization:
def test_conference_and_division_filters(self):
"""Test conference and division filtering parameters."""
endpoint = TeamGameLogs(
vs_conference_nullable="East",
vs_division_nullable="Atla... | "Atlantic" | assert | string_literal | tests/unit/stats/endpoints/test_teamgamelogs.py | test_conference_and_division_filters | TestTeamGameLogsInitialization | 54 | null |
swar/nba_api | from typing import Any
from unittest.mock import Mock, patch
import pytest
from nba_api.stats.endpoints import TeamDashLineups
from .data.teamdashlineups import TEAMDASHLINEUPS_SAMPLE
def json_fixture() -> dict[str, Any]:
"""Load the TeamDashLineups fixture."""
return TEAMDASHLINEUPS_SAMPLE
class TestTeamD... | 5 | assert | numeric_literal | tests/unit/stats/endpoints/test_teamdashlineups.py | test_endpoint_initialization_with_filters | TestTeamDashLineupsEndpoint | 49 | null |
swar/nba_api | import json
import pytest
from nba_api.library.http import NBAHTTP, NBAResponse
from nba_api.live.nba.endpoints import boxscore
from nba_api.live.nba.library.http import NBALiveHTTP
content = {
"meta": {
"version": 1,
"code": 200,
"request": "http://nba.cloud/games/0022000180/boxscore?For... | content["game"]["homeTeam"] | assert | complex_expr | tests/unit/live/endpoints/test_live_boxscore.py | test_home_team_dict | 513 | null | |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscorematchupsv3 import (
NBAStatsBoxscoreMatchupsParserV3,
)
def json_fixture():
"""Load the BoxScoreMatchupsV3 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_a... | result | assert | variable | tests/unit/stats/endpoints/test_boxscorematchupsv3_parser.py | test_get_data_sets | TestNBAStatsBoxscoreMatchupsParserV3 | 78 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoreusagev3 import (
NBAStatsBoxscoreUsageV3Parser,
)
from .data.boxscoreusagev3 import BOXSCOREUSAGEV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsBoxscoreUsageV3Parser(BOXSCOREUSAGEV3_SAMPLE)
def js... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoreusagev3_parser.py | test_parser_with_full_response | TestNBAStatsBoxscoreUsageV3Parser | 241 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscorehustlev2 import (
NBAStatsBoxscoreHustleV2Parser,
)
def json_fixture():
"""Load the BoxScoreHustleV2 JSON fixture."""
fixture_path = (
Path(__file__).parents[4]
/ "docs"
/ "nba_api"
... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscorehustlev2_parser.py | test_get_player_data | TestNBAStatsBoxscoreHustleV2Parser | 114 | null |
swar/nba_api | 0.125,
0,
0.333,
0,
0,
0.5,
0.375,
0.147,
],
],
},
"TeamStats": {
... | response["exp_parameters"] | assert | complex_expr | tests/unit/stats/library/test_stats_library_nbastatsresponse.py | test_get_parameters | TestNBAStatsResponse | 784 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.playbyplayv3 import NBAStatsPlayByPlayParserV3
from .data.playbyplayv3 import (
PLAYBYPLAYV3_EMPTY,
PLAYBYPLAYV3_MINIMAL,
PLAYBYPLAYV3_SAMPLE,
)
def parser():
"""Create parser with sample data."""
return NBAStatsPlayByPlayParserV3(PLAYBYPLAYV3_S... | 3 | assert | numeric_literal | tests/unit/stats/endpoints/test_playbyplayv3_parser.py | test_data_types_preserved | TestNBAStatsPlayByPlayParserV3 | 212 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoredefensivev2 import (
NBAStatsBoxscoreDefensiveV2Parser,
)
from .data.boxscoredefensivev2 import BOXSCOREDEFENSIVEV2_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStat... | None | assert | none_literal | tests/unit/stats/endpoints/test_boxscoredefensivev2_parser.py | test_get_team_data | TestNBAStatsBoxscoreDefensiveV2Parser | 104 | null |
swar/nba_api | from unittest.mock import Mock, patch
from nba_api.stats.endpoints import ScoreboardV3
from nba_api.stats.endpoints._parsers.scoreboardv3 import (
NBAStatsScoreboardV3Parser,
)
from .data.scoreboardv3 import SCOREBOARDV3_SAMPLE
class TestScoreboardV3Endpoint:
def test_expected_data_matches_parser_headers(se... | tuple(_EXPECTED_DATA["LineScore"]) | assert | func_call | tests/unit/stats/endpoints/test_scoreboardv3.py | test_expected_data_matches_parser_headers | TestScoreboardV3Endpoint | 66 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscorescoringv3 import (
NBAStatsBoxscoreScoringV3Parser,
)
from .data.boxscorescoringv3 import BOXSCORESCORINGV3_SAMPLE
def json_fixture():
"""Return the BoxScoreScoringV3 sample fixture."""
return BOXSCORESCORINGV3_SAMPLE
class TestBoxscoreScoringV... | "CON" | assert | string_literal | tests/unit/stats/endpoints/test_boxscorescoringv3_parser.py | test_get_team_data | TestBoxscoreScoringV3Parser | 82 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscoreusagev3 import (
NBAStatsBoxscoreUsageV3Parser,
)
from .data.boxscoreusagev3 import BOXSCOREUSAGEV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsBoxscoreUsageV3Parser(BOXSCOREUSAGEV3_SAMPLE)
def js... | "CLE" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoreusagev3_parser.py | test_get_team_data | TestNBAStatsBoxscoreUsageV3Parser | 110 | null |
swar/nba_api | from nba_api.stats.endpoints import TeamGameLogs
class TestTeamGameLogsInitialization:
def test_endpoint_initialization_without_request(self):
"""Test endpoint initializes without making HTTP request."""
endpoint = TeamGameLogs(
team_id_nullable="1610612747",
season_nullabl... | "2023-24" | assert | string_literal | tests/unit/stats/endpoints/test_teamgamelogs.py | test_endpoint_initialization_without_request | TestTeamGameLogsInitialization | 19 | null |
swar/nba_api | import pytest
from tests.integration.helpers.constants import GAME_ID, PLAYER_ID
from tests.integration.helpers.models import EndpointSpec
def test_endpoint_spec_accepts_override_for_non_default_required_param():
endpoint = EndpointSpec(CustomRequiredEndpoint, custom_required="ok")()
assert endpoint.game_id ... | "ok" | assert | string_literal | tests/unit/integration/helpers/test_endpoint_spec.py | test_endpoint_spec_accepts_override_for_non_default_required_param | 70 | null | |
swar/nba_api | import pytest
from tests.integration.helpers.constants import GAME_ID, PLAYER_ID
from tests.integration.helpers.models import EndpointSpec
def test_endpoint_spec_raises_clear_error_for_unresolvable_required_params():
spec = EndpointSpec(CustomRequiredEndpoint)
with pytest.raises( | ValueError) | pytest.raises | variable | tests/unit/integration/helpers/test_endpoint_spec.py | test_endpoint_spec_raises_clear_error_for_unresolvable_required_params | 57 | null | |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoreadvancedv3 import (
NBAStatsBoxscoreAdvancedV3Parser,
)
from .data.boxscoreadvancedv3 import BOXSCOREADVANCEDV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsBox... | headers | assert | variable | tests/unit/stats/endpoints/test_boxscoreadvancedv3_parser.py | test_get_team_headers | TestNBAStatsBoxscoreAdvancedV3Parser | 51 | null |
swar/nba_api | import json
from pathlib import Path
import pytest
from nba_api.stats.endpoints._parsers.boxscoreadvancedv3 import (
NBAStatsBoxscoreAdvancedV3Parser,
)
from .data.boxscoreadvancedv3 import BOXSCOREADVANCEDV3_SAMPLE
def parser():
"""Create parser instance with minimal test fixture."""
return NBAStatsBox... | "CON" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoreadvancedv3_parser.py | test_get_team_data | TestNBAStatsBoxscoreAdvancedV3Parser | 99 | null |
swar/nba_api | import pytest
from nba_api.stats.endpoints._parsers.boxscorescoringv3 import (
NBAStatsBoxscoreScoringV3Parser,
)
from .data.boxscorescoringv3 import BOXSCORESCORINGV3_SAMPLE
def json_fixture():
"""Return the BoxScoreScoringV3 sample fixture."""
return BOXSCORESCORINGV3_SAMPLE
class TestBoxscoreScoringV... | 2 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscorescoringv3_parser.py | test_get_team_data | TestBoxscoreScoringV3Parser | 70 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.