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 |
|---|---|---|---|---|---|---|---|---|---|
ruvnet/wifi-densepose | import pytest
import torch
import numpy as np
from unittest.mock import Mock, patch, MagicMock
from src.core.csi_processor import CSIProcessor
from src.core.phase_sanitizer import PhaseSanitizer
from src.hardware.router_interface import RouterInterface
from src.hardware.csi_extractor import CSIExtractor
class TestCSIP... | small_sanitized.shape | assert | complex_expr | v1/tests/integration/test_csi_pipeline.py | test_pipeline_handles_different_data_sizes | TestCSIPipeline | 242 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
import sys
import os
from unittest.mock import Mock, patch, AsyncMock
import asyncio
from datetime import datetime, timezone
import importlib.util
spec = importlib.util.spec_from_file_location(
'csi_extractor',
'/workspaces/wifi-densepose/src/hardware/csi_extractor.py'
)
csi_m... | True | assert | bool_literal | v1/tests/unit/test_csi_standalone.py | test_validate_success | TestCSIExtractorStandalone | 296 | null |
ruvnet/wifi-densepose | import pytest
import torch
import numpy as np
from unittest.mock import Mock, patch, MagicMock
from src.core.csi_processor import CSIProcessor
from src.core.phase_sanitizer import PhaseSanitizer
from src.hardware.router_interface import RouterInterface
from src.hardware.csi_extractor import CSIExtractor
class TestCSIP... | ValueError) | pytest.raises | variable | v1/tests/integration/test_csi_pipeline.py | test_pipeline_handles_invalid_csi_data_format | TestCSIPipeline | 176 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
import numpy as np
from datetime import datetime, timedelta
from typing import Dict, Any, List, Optional, AsyncGenerator
from unittest.mock import AsyncMock, MagicMock, patch
import json
import queue
import threading
from dataclasses import dataclass
class TestStreamingPipelineBasic:
... | 1 | assert | numeric_literal | v1/tests/integration/test_streaming_pipeline.py | test_buffer_overflow_handling_should_fail_initially | TestStreamingPipelineBasic | 299 | null |
ruvnet/wifi-densepose | import pytest
import torch
import numpy as np
from unittest.mock import Mock, patch, MagicMock
from src.core.csi_processor import CSIProcessor
from src.core.phase_sanitizer import PhaseSanitizer
from src.models.modality_translation import ModalityTranslationNetwork
from src.models.densepose_head import DensePoseHead
c... | 8 | assert | numeric_literal | v1/tests/integration/test_inference_pipeline.py | test_inference_pipeline_handles_different_batch_sizes | TestInferencePipeline | 197 | null |
ruvnet/wifi-densepose | import pytest
import torch
import numpy as np
from unittest.mock import Mock, patch, MagicMock
from src.core.csi_processor import CSIProcessor
from src.core.phase_sanitizer import PhaseSanitizer
from src.hardware.router_interface import RouterInterface
from src.hardware.csi_extractor import CSIExtractor
class TestCSIP... | large_sanitized.shape | assert | complex_expr | v1/tests/integration/test_csi_pipeline.py | test_pipeline_handles_different_data_sizes | TestCSIPipeline | 243 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
from unittest.mock import Mock, patch, MagicMock
from src.hardware.router_interface import RouterInterface, RouterConnectionError
class TestRouterInterface:
def mock_config(self):
"""Configuration for router interface"""
return {
'router_ip': '192.168.1... | True | assert | bool_literal | v1/tests/unit/test_router_interface.py | test_connect_establishes_ssh_connection | TestRouterInterface | 61 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
import aiohttp
import time
import numpy as np
from datetime import datetime, timedelta
from typing import Dict, Any, List, Optional
from unittest.mock import AsyncMock, MagicMock, patch
import json
import statistics
class TestAPIThroughput:
def api_server(self):
"""Create mock... | 200 | assert | numeric_literal | v1/tests/performance/test_api_throughput.py | test_single_request_performance_should_fail_initially | TestAPIThroughput | 196 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
import torch
from unittest.mock import Mock, patch, MagicMock
from src.hardware.csi_extractor import CSIExtractor, CSIExtractionError
class TestCSIExtractor:
def mock_config(self):
"""Configuration for CSI extractor"""
return {
'interface': 'wlan0',
... | new_channel | assert | variable | v1/tests/unit/test_csi_extractor.py | test_set_channel_configures_wifi_channel | TestCSIExtractor | 194 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
import numpy as np
from datetime import datetime, timedelta
from typing import Dict, Any, List, Optional
from unittest.mock import AsyncMock, MagicMock, patch
import json
from dataclasses import dataclass
from enum import Enum
class TestHealthcareFallDetection:
def patient_monitor(sel... | "patient_001" | assert | string_literal | v1/tests/e2e/test_healthcare_scenario.py | test_prolonged_inactivity_detection_should_fail_initially | TestHealthcareFallDetection | 430 | null |
ruvnet/wifi-densepose | import asyncio
import aiohttp
import json
import sys
from datetime import datetime
from typing import Dict, Any, List
import time
class MonitoringTester:
def __init__(self, base_url: str = "http://localhost:8000"):
self.base_url = base_url
self.session = None
self.results = []
async d... | data | assert | variable | v1/scripts/test_monitoring.py | test_health_endpoint | MonitoringTester | 51 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
from unittest.mock import Mock, patch, MagicMock
from src.hardware.router_interface import RouterInterface, RouterConnectionError
class TestRouterInterface:
def mock_config(self):
"""Configuration for router interface"""
return {
'router_ip': '192.168.1... | ValueError) | pytest.raises | variable | v1/tests/unit/test_router_interface.py | test_interface_validates_configuration | TestRouterInterface | 229 | null |
ruvnet/wifi-densepose | import pytest
import torch
import numpy as np
from unittest.mock import Mock, patch, MagicMock
from src.core.csi_processor import CSIProcessor
from src.core.phase_sanitizer import PhaseSanitizer
from src.hardware.router_interface import RouterInterface
from src.hardware.csi_extractor import CSIExtractor
class TestCSIP... | None | assert | none_literal | v1/tests/integration/test_csi_pipeline.py | test_end_to_end_csi_pipeline_processes_data_correctly | TestCSIPipeline | 130 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
import numpy as np
from datetime import datetime, timedelta
from typing import Dict, Any, List, Optional
from unittest.mock import AsyncMock, MagicMock, patch
import json
from dataclasses import dataclass
from enum import Enum
class TestHealthcareFallDetection:
def patient_monitor(sel... | True | assert | bool_literal | v1/tests/e2e/test_healthcare_scenario.py | test_fall_detection_workflow_should_fail_initially | TestHealthcareFallDetection | 354 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
import sys
import os
from unittest.mock import Mock, patch, AsyncMock, MagicMock
from datetime import datetime, timezone
import importlib.util
from typing import Dict, List, Any
spec = importlib.util.spec_from_file_location(
'csi_processor',
'/workspaces/wifi-densepose/src/cor... | 1 | assert | numeric_literal | v1/tests/unit/test_csi_processor_tdd.py | test_should_add_csi_data_to_history | TestCSIProcessor | 324 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
from datetime import datetime, timedelta
from typing import Dict, Any, Optional
from unittest.mock import AsyncMock, MagicMock, patch
import jwt
import json
from fastapi import HTTPException, status
from fastapi.security import HTTPAuthorizationCredentials
class TestUserAuthentication:
... | [] | assert | collection | v1/tests/integration/test_authentication.py | test_admin_user_authentication_should_fail_initially | TestUserAuthentication | 279 | null |
ruvnet/wifi-densepose | import pytest
import torch
import numpy as np
from unittest.mock import Mock, patch, MagicMock
from src.core.csi_processor import CSIProcessor
from src.core.phase_sanitizer import PhaseSanitizer
from src.models.modality_translation import ModalityTranslationNetwork
from src.models.densepose_head import DensePoseHead
c... | 4 | assert | numeric_literal | v1/tests/integration/test_inference_pipeline.py | test_inference_pipeline_memory_efficiency | TestInferencePipeline | 364 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
import numpy as np
from datetime import datetime, timedelta
from typing import Dict, Any, List, Optional
from unittest.mock import AsyncMock, MagicMock, patch
import json
import socket
class TestCSIDataCollection:
def csi_collector(self):
"""Create CSI data collector."""
... | 0 | assert | numeric_literal | v1/tests/integration/test_hardware_integration.py | test_collection_statistics_should_fail_initially | TestCSIDataCollection | 427 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
import sys
import os
from unittest.mock import Mock, patch, AsyncMock
from datetime import datetime, timezone
import importlib.util
spec = importlib.util.spec_from_file_location(
'phase_sanitizer',
'/workspaces/wifi-densepose/src/core/phase_sanitizer.py'
)
phase_sanitizer_modu... | 5 | assert | numeric_literal | v1/tests/unit/test_phase_sanitizer_tdd.py | test_should_initialize_with_valid_config | TestPhaseSanitizer | 82 | null |
ruvnet/wifi-densepose | import pytest
import torch
import torch.nn as nn
import numpy as np
from unittest.mock import Mock, patch
from src.models.modality_translation import ModalityTranslationNetwork, ModalityTranslationError
class TestModalityTranslationNetwork:
def mock_config(self):
"""Configuration for modality translation ... | features | assert | variable | v1/tests/unit/test_modality_translation.py | test_feature_visualization_support | TestModalityTranslationNetwork | 290 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
from unittest.mock import Mock, patch, AsyncMock, MagicMock
from typing import Dict, Any, Optional
import asyncio
from datetime import datetime, timezone
from src.hardware.csi_extractor import (
CSIExtractor,
CSIParseError,
CSIData,
ESP32CSIParser,
RouterCSIParser,
... | 'esp32' | assert | string_literal | v1/tests/unit/test_csi_extractor_tdd.py | test_should_initialize_with_valid_config | TestCSIExtractor | 70 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
from datetime import datetime, timedelta
from typing import Dict, Any
from unittest.mock import AsyncMock, MagicMock
from fastapi.testclient import TestClient
from fastapi import FastAPI
import httpx
from src.api.dependencies import (
get_pose_service,
get_stream_service,
get_... | data | assert | variable | v1/tests/integration/test_api_endpoints.py | test_readiness_check_endpoint_should_fail_initially | TestAPIEndpoints | 133 | null |
ruvnet/wifi-densepose | import pytest
import torch
import torch.nn as nn
import numpy as np
from unittest.mock import Mock, patch
from src.models.modality_translation import ModalityTranslationNetwork, ModalityTranslationError
class TestModalityTranslationNetwork:
def mock_config(self):
"""Configuration for modality translation ... | None | assert | none_literal | v1/tests/unit/test_modality_translation.py | test_network_initialization_creates_correct_architecture | TestModalityTranslationNetwork | 58 | null |
ruvnet/wifi-densepose | import asyncio
import pytest
import httpx
import json
import time
from pathlib import Path
from typing import Dict, Any
from unittest.mock import AsyncMock, MagicMock, patch
from src.config.settings import get_settings
from src.app import app
from src.database.connection import get_database_manager
from src.services.o... | 422 | assert | numeric_literal | v1/tests/integration/test_full_system_integration.py | test_error_handling_integration | TestFullSystemIntegration | 246 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
from unittest.mock import Mock, patch, MagicMock
from src.hardware.router_interface import RouterInterface, RouterConnectionError
class TestRouterInterface:
def mock_config(self):
"""Configuration for router interface"""
return {
'router_ip': '192.168.1... | mock_config['timeout'] | assert | complex_expr | v1/tests/unit/test_router_interface.py | test_interface_initialization_creates_correct_configuration | TestRouterInterface | 47 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
from unittest.mock import Mock, patch, AsyncMock, MagicMock
from typing import Dict, Any, Optional
import asyncio
from datetime import datetime, timezone
from src.hardware.csi_extractor import (
CSIExtractor,
CSIParseError,
CSIData,
ESP32CSIParser,
RouterCSIParser,
... | mock_config | assert | variable | v1/tests/unit/test_csi_extractor_tdd.py | test_should_initialize_with_valid_config | TestCSIExtractor | 67 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
import numpy as np
from datetime import datetime, timedelta
from typing import Dict, Any, List, Optional, AsyncGenerator
from unittest.mock import AsyncMock, MagicMock, patch
import json
import queue
import threading
from dataclasses import dataclass
class TestStreamingPipelineIntegration:... | 10 | assert | numeric_literal | v1/tests/integration/test_streaming_pipeline.py | test_pipeline_performance_should_fail_initially | TestStreamingPipelineIntegration | 529 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
import sys
import os
from unittest.mock import Mock, patch, AsyncMock, MagicMock
from typing import Dict, Any, Optional
import asyncio
from datetime import datetime, timezone
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../'))
from src.hardware.csi_extractor import (... | 2 | assert | numeric_literal | v1/tests/unit/test_csi_extractor_direct.py | test_extract_max_retries_exceeded | TestCSIExtractorDirect | 282 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
from unittest.mock import Mock, patch
from src.core.phase_sanitizer import PhaseSanitizer
class TestPhaseSanitizer:
def mock_phase_data(self):
"""Generate synthetic phase data for testing"""
# Phase data with unwrapping issues and outliers
return np.array([... | mock_phase_data.shape | assert | complex_expr | v1/tests/unit/test_phase_sanitizer.py | test_unwrap_phase_removes_discontinuities | TestPhaseSanitizer | 33 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
import sys
import os
from unittest.mock import Mock, patch, AsyncMock, MagicMock
from datetime import datetime, timezone
import importlib.util
import unittest.mock
RouterInterface = router_module.RouterInterface
RouterConnectionError = router_module.RouterConnectionError
CSIData = csi_mod... | 22 | assert | numeric_literal | v1/tests/unit/test_router_interface_tdd.py | test_should_initialize_with_valid_config | TestRouterInterface | 76 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
import torch
from unittest.mock import Mock, patch, MagicMock
from src.hardware.csi_extractor import CSIExtractor, CSIExtractionError
class TestCSIExtractor:
def mock_config(self):
"""Configuration for CSI extractor"""
return {
'interface': 'wlan0',
... | stats | assert | variable | v1/tests/unit/test_csi_extractor.py | test_get_extraction_stats_returns_valid_statistics | TestCSIExtractor | 178 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
import json
from datetime import datetime
from typing import Dict, Any, List
from unittest.mock import AsyncMock, MagicMock, patch
import websockets
from fastapi import FastAPI, WebSocket
from fastapi.testclient import TestClient
class TestWebSocketPerformance:
@pytest.mark.asyncio
... | 100 | assert | numeric_literal | v1/tests/integration/test_websocket_streaming.py | test_websocket_message_throughput_should_fail_initially | TestWebSocketPerformance | 419 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
from unittest.mock import Mock, patch, AsyncMock, MagicMock
from typing import Dict, Any, Optional
import asyncio
from datetime import datetime, timezone
from src.hardware.csi_extractor import (
CSIExtractor,
CSIParseError,
CSIData,
ESP32CSIParser,
RouterCSIParser,
... | False | assert | bool_literal | v1/tests/unit/test_csi_extractor_tdd.py | test_should_initialize_with_valid_config | TestCSIExtractor | 69 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
import json
from datetime import datetime
from typing import Dict, Any, List
from unittest.mock import AsyncMock, MagicMock, patch
import websockets
from fastapi import FastAPI, WebSocket
from fastapi.testclient import TestClient
class TestWebSocketStreaming:
def mock_websocket(self)... | "pong" | assert | string_literal | v1/tests/integration/test_websocket_streaming.py | test_websocket_message_handling_should_fail_initially | TestWebSocketStreaming | 173 | null |
ruvnet/wifi-densepose | import pytest
import torch
import torch.nn as nn
import numpy as np
from unittest.mock import Mock, patch
from src.models.densepose_head import DensePoseHead, DensePoseError
class TestDensePoseHead:
def mock_config(self):
"""Configuration for DensePose head"""
return {
'input_channels'... | None | assert | none_literal | v1/tests/unit/test_densepose_head.py | test_head_initialization_creates_correct_architecture | TestDensePoseHead | 67 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
import numpy as np
import time
from datetime import datetime, timedelta
from typing import Dict, Any, List, Optional
from unittest.mock import AsyncMock, MagicMock, patch
import psutil
import os
class TestInferenceSpeed:
def lightweight_model(self):
"""Create lightweight model... | 500 | assert | numeric_literal | v1/tests/performance/test_inference_speed.py | test_model_complexity_comparison_should_fail_initially | TestInferenceSpeed | 179 | null |
ruvnet/wifi-densepose | import pytest
import asyncio
import numpy as np
from datetime import datetime, timedelta
from typing import Dict, Any, List, Optional, AsyncGenerator
from unittest.mock import AsyncMock, MagicMock, patch
import json
import queue
import threading
from dataclasses import dataclass
class TestStreamingPipelineIntegration:... | 5 | assert | numeric_literal | v1/tests/integration/test_streaming_pipeline.py | test_end_to_end_streaming_should_fail_initially | TestStreamingPipelineIntegration | 489 | null |
ruvnet/wifi-densepose | import pytest
import torch
import numpy as np
from unittest.mock import Mock, patch, MagicMock
from src.core.csi_processor import CSIProcessor
from src.core.phase_sanitizer import PhaseSanitizer
from src.hardware.router_interface import RouterInterface
from src.hardware.csi_extractor import CSIExtractor
class TestCSIP... | 3 | assert | numeric_literal | v1/tests/integration/test_csi_pipeline.py | test_pipeline_supports_concurrent_processing | TestCSIPipeline | 350 | null |
ruvnet/wifi-densepose | import pytest
import numpy as np
import sys
import os
from unittest.mock import Mock, patch, AsyncMock, MagicMock
from typing import Dict, Any, Optional
import asyncio
from datetime import datetime, timezone
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../'))
from src.hardware.csi_extractor import (... | True | assert | bool_literal | v1/tests/unit/test_csi_extractor_direct.py | test_should_validate_csi_data_successfully | TestCSIExtractorDirect | 291 | null |
ruvnet/wifi-densepose | import pytest
import torch
import torch.nn as nn
import numpy as np
from unittest.mock import Mock, patch
from src.models.modality_translation import ModalityTranslationNetwork, ModalityTranslationError
class TestModalityTranslationNetwork:
def mock_config(self):
"""Configuration for modality translation ... | 0 | assert | numeric_literal | v1/tests/unit/test_modality_translation.py | test_compute_translation_loss_measures_feature_alignment | TestModalityTranslationNetwork | 180 | 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... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_playbyplayv3_parser.py | test_handles_empty_actions | TestNBAStatsPlayByPlayParserV3 | 146 | 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... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_iststandings_parser.py | test_get_iststandings_headers_returns_list | TestNBAStatsISTStandingsParser | 51 | 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... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_dunkscoreleaders.py | test_json_fixture_structure | TestDunkScoreLeadersEndpoint | 122 | 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... | "F" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoreusagev3_parser.py | test_get_player_data | TestNBAStatsBoxscoreUsageV3Parser | 143 | 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... | dict(call_kwargs["params"]) | assert | func_call | tests/unit/http/test_http.py | test_endpoint_uses_global_session | 49 | 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"
... | result | assert | variable | tests/unit/stats/endpoints/test_boxscorehustlev2_parser.py | test_get_data_sets | TestNBAStatsBoxscoreHustleV2Parser | 130 | 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 ... | 2 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoreplayertrackv3_parser.py | test_get_team_data_has_two_rows | TestBoxScorePlayerTrackV3ParserTeamData | 148 | 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_missing_coaches_dataset(self, mock_request):
"""Test endpoint handles ... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_commonteamroster.py | test_endpoint_with_missing_coaches_dataset | TestCommonTeamRosterEndpoint | 73 | 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():
... | 1 | assert | numeric_literal | tests/unit/stats/endpoints/test_scoreboardv3_parser.py | test_get_scoreboard_info_data | TestNBAStatsScoreboardV3Parser | 45 | 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["team"] | assert | complex_expr | tests/unit/stats/library/test_playbyplayregex.py | test_foul_player | 142 | 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_structure(self):
... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_scoreboardv3.py | test_expected_data_structure | TestScoreboardV3Endpoint | 51 | 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... | "Made" | assert | string_literal | tests/unit/stats/endpoints/test_playbyplayv3_parser.py | test_data_types_preserved | TestNBAStatsPlayByPlayParserV3 | 211 | 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... | "Totals" | assert | string_literal | tests/unit/stats/endpoints/test_teamdashlineups.py | test_endpoint_initialization_with_filters | TestTeamDashLineupsEndpoint | 51 | 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... | call_kwargs | assert | variable | tests/unit/http/test_http.py | test_endpoint_uses_global_session | 48 | 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... | 1 | assert | numeric_literal | tests/unit/stats/endpoints/test_playbyplayv3_parser.py | test_get_videoavailable_headers | TestNBAStatsPlayByPlayParserV3 | 103 | 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... | str(w[0].message) | assert | func_call | tests/unit/stats/endpoints/test_leaguegamefinder.py | test_game_id_nullable_emits_warning | TestLeagueGameFinderWarnings | 26 | 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... | headers | assert | variable | tests/unit/stats/endpoints/test_boxscoredefensivev2_parser.py | test_get_team_headers | TestNBAStatsBoxscoreDefensiveV2Parser | 51 | 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 ... | {} | assert | collection | tests/unit/stats/endpoints/test_boxscoreplayertrackv3_parser.py | test_parser_initialization_with_missing_root_key | TestBoxScorePlayerTrackV3ParserInitialization | 91 | 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... | None | assert | none_literal | tests/unit/stats/endpoints/test_playbyplayv3_parser.py | test_parser_initialization | TestNBAStatsPlayByPlayParserV3 | 37 | 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":... | odds.Odds().get_response() | assert | func_call | tests/unit/live/endpoints/test_live_odds.py | test_get_response | 427 | 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"]["officials"] | assert | complex_expr | tests/unit/live/endpoints/test_live_boxscore.py | test_officials_dict | 547 | null | |
swar/nba_api | import importlib
from unittest.mock import Mock, mock_open, patch
import pytest
import requests
from nba_api.live.nba.endpoints import scoreboard
from nba_api.stats.endpoints import assistleaders
DEFAULT_STATS_HEADERS = {
"Host": "stats.nba.com",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)... | None | assert | none_literal | tests/unit/http/test_legacy_debug_usage.py | test_stats_endpoint_default_no_proxy | 195 | null | |
swar/nba_api | import importlib
from unittest.mock import Mock, mock_open, patch
import pytest
import requests
from nba_api.live.nba.endpoints import scoreboard
from nba_api.stats.endpoints import assistleaders
DEFAULT_STATS_HEADERS = {
"Host": "stats.nba.com",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)... | PROXIES | assert | variable | tests/unit/http/test_legacy_debug_usage.py | test_stats_endpoint_custom_proxy_in_call | 200 | 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... | result | assert | variable | tests/unit/stats/endpoints/test_boxscoreadvancedv3_parser.py | test_parser_with_full_response | TestNBAStatsBoxscoreAdvancedV3Parser | 176 | null |
swar/nba_api | from importlib.metadata import version
import nba_api
def test_version_matches_metadata():
assert nba_api.__version__ == | version("nba_api") | assert | func_call | tests/unit/package/test_version.py | test_version_matches_metadata | 19 | 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 ... | None | assert | none_literal | tests/unit/stats/endpoints/test_scheduleleaguev2.py | test_get_data_sets_2020 | TestNBAStatsScheduleLeagueV2Parser | 142 | 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... | "2023-24" | assert | string_literal | tests/unit/integration/helpers/test_endpoint_spec.py | test_endpoint_spec_overrides_win_for_required_and_optional_params | 51 | null | |
swar/nba_api | import pytest
from nba_api.stats.endpoints import TeamGameLog
class TestTeamGameLogInitialization:
def test_endpoint_initialization_without_request(self):
"""Test endpoint initializes without making HTTP request."""
endpoint = TeamGameLog(
team_id="1610612747",
season="202... | "2023-24" | assert | string_literal | tests/unit/stats/endpoints/test_teamgamelog.py | test_endpoint_initialization_without_request | TestTeamGameLogInitialization | 21 | 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":... | content["games"] | assert | complex_expr | tests/unit/live/endpoints/test_live_odds.py | test_games_dict | 435 | 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"]["awayTeam"] | assert | complex_expr | tests/unit/live/endpoints/test_live_boxscore.py | test_away_team_dict | 530 | 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"
... | types | assert | variable | tests/unit/stats/endpoints/test_scheduleleaguev2_parser.py | test_get_broadcaster_types | TestNBAStatsScheduleLeagueV2Parser | 185 | 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."""
... | 25 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoremiscv3_parser.py | test_team_statistics_values | TestBoxscoreMiscV3Parser | 190 | 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_missing_coaches_dataset(self, mock_request):
"""Test endpoint handles ... | 1 | assert | numeric_literal | tests/unit/stats/endpoints/test_commonteamroster.py | test_endpoint_with_missing_coaches_dataset | TestCommonTeamRosterEndpoint | 90 | 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."""
... | "29:59" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoremiscv3_parser.py | test_player_stats_extracted | TestBoxscoreMiscV3Parser | 145 | 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"
... | game_id | assert | variable | tests/unit/stats/endpoints/test_boxscorehustlev2_parser.py | test_get_team_data | TestNBAStatsBoxscoreHustleV2Parser | 106 | null |
swar/nba_api | from nba_api.stats.endpoints import TeamGameLogs
class TestTeamGameLogsInitialization:
def test_multiple_filter_parameters(self):
"""Test various filtering parameters."""
endpoint = TeamGameLogs(
team_id_nullable="1610612747",
season_nullable="2023-24",
location... | "W" | assert | string_literal | tests/unit/stats/endpoints/test_teamgamelogs.py | test_multiple_filter_parameters | TestTeamGameLogsInitialization | 42 | 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... | 2 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoresummaryv3.py | test_get_line_score_data | TestNBAStatsBoxscoreSummaryParserV3 | 123 | 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"
... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_scheduleleaguev2_parser.py | test_get_weeks_headers_returns_tuple | TestNBAStatsScheduleLeagueV2Parser | 70 | 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"
... | headers | assert | variable | tests/unit/stats/endpoints/test_scheduleleaguev2_parser.py | test_get_weeks_headers_structure | TestNBAStatsScheduleLeagueV2Parser | 77 | 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... | 2 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscorefourfactorsv3_parser.py | test_get_team_data | TestNBAStatsBoxscoreFourFactorsV3Parser | 87 | 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=... | "T" | assert | string_literal | tests/unit/stats/endpoints/test_leaguegamefinder.py | test_endpoint_initialization_without_request | TestLeagueGameFinderInitialization | 71 | 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 ... | 0 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoreplayertrackv3_parser.py | test_parser_with_no_players | TestBoxScorePlayerTrackV3ParserEdgeCases | 377 | 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 ... | None | assert | none_literal | tests/unit/stats/endpoints/test_boxscoreplayertrackv3_parser.py | test_parser_with_missing_statistics | TestBoxScorePlayerTrackV3ParserEdgeCases | 423 | 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["short"] | assert | complex_expr | tests/unit/stats/library/test_playbyplayregex.py | test_timeout | 332 | 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... | "SEA" | assert | string_literal | tests/unit/stats/endpoints/test_boxscorescoringv3_parser.py | test_get_team_data | TestBoxscoreScoringV3Parser | 91 | 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... | content | assert | variable | tests/unit/live/endpoints/test_live_playbyplay.py | test_get_dict | 131 | 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... | headers | assert | variable | tests/unit/stats/endpoints/test_boxscorefourfactorsv3_parser.py | test_get_team_headers | TestNBAStatsBoxscoreFourFactorsV3Parser | 51 | 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... | "US" | assert | string_literal | tests/unit/stats/endpoints/test_boxscoresummaryv3.py | test_get_arena_info_data | TestNBAStatsBoxscoreSummaryParserV3 | 89 | 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... | {} | assert | collection | tests/unit/stats/endpoints/test_boxscoreusagev3_parser.py | test_parser_initialization_with_missing_boxscore | TestNBAStatsBoxscoreUsageV3Parser | 282 | 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["blocks"] | assert | complex_expr | tests/unit/stats/library/test_playbyplayregex.py | test_block_player | 42 | 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."""
... | 6 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoremiscv3_parser.py | test_player_stats_extracted | TestBoxscoreMiscV3Parser | 146 | 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... | len(headers) | assert | func_call | tests/unit/stats/endpoints/test_boxscorematchupsv3_parser.py | test_data_row_count_matches_headers | TestNBAStatsBoxscoreMatchupsParserV3 | 109 | 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... | 2 | assert | numeric_literal | tests/unit/stats/endpoints/test_boxscoretraditionalv3_parser.py | test_get_team_data | TestNBAStatsBoxscoreTraditionalParserV3 | 80 | null |
swar/nba_api | 0.125,
0,
0.333,
0,
0,
0.5,
0.375,
0.147,
],
],
},
"TeamStats": {
... | response["exp_data_sets"] | assert | complex_expr | tests/unit/stats/library/test_stats_library_nbastatsresponse.py | test_get_data_sets | TestNBAStatsResponse | 808 | 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... | first_dunk | assert | variable | tests/unit/stats/endpoints/test_dunkscoreleaders.py | test_json_fixture_dunk_fields | TestDunkScoreLeadersEndpoint | 129 | null |
swar/nba_api | from nba_api.stats.endpoints import TeamGameLogs
class TestTeamGameLogsInitialization:
def test_multiple_filter_parameters(self):
"""Test various filtering parameters."""
endpoint = TeamGameLogs(
team_id_nullable="1610612747",
season_nullable="2023-24",
location... | "10" | assert | string_literal | tests/unit/stats/endpoints/test_teamgamelogs.py | test_multiple_filter_parameters | TestTeamGameLogsInitialization | 43 | 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":... | content["games"][0]["markets"] | assert | complex_expr | tests/unit/live/endpoints/test_live_odds.py | test_first_game_markets | 440 | null | |
swar/nba_api | import re
from nba_api.stats.library.parameters import (
Season,
SeasonType,
SeasonTypeAllStar,
SeasonTypeAllStarNullable,
SeasonTypeNullable,
SeasonTypePlayoffs,
_NotRequired,
)
def test_season_type_nullable():
assert SeasonTypeNullable.regular == "Regular Season"
assert SeasonTyp... | "" | assert | string_literal | tests/unit/stats/library/test_parameters.py | test_season_type_nullable | 62 | null | |
swar/nba_api | from nba_api.stats.endpoints import TeamGameLogs
class TestTeamGameLogsInitialization:
def test_multiple_filter_parameters(self):
"""Test various filtering parameters."""
endpoint = TeamGameLogs(
team_id_nullable="1610612747",
season_nullable="2023-24",
location... | "Home" | assert | string_literal | tests/unit/stats/endpoints/test_teamgamelogs.py | test_multiple_filter_parameters | TestTeamGameLogsInitialization | 41 | 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."""
... | None | assert | none_literal | tests/unit/stats/endpoints/test_boxscoremiscv3_parser.py | test_missing_fields_handled_gracefully | TestBoxscoreMiscV3Parser | 231 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.