repo_id stringclasses 400
values | commit_sha stringclasses 400
values | commit_index int32 0 951 | in_repo_split stringclasses 1
value | cross_repo_split stringclasses 1
value | test_file stringlengths 7 121 | test_function stringlengths 1 108 | assertion_type stringclasses 32
values | difficulty stringclasses 8
values | context_lines int32 3 600 | prefix large_stringlengths 44 113k | target large_stringlengths 1 498 | anchor_sha stringclasses 400
values | anchor_index int32 0 951 | qna_source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/mcp/test_async_lifecycle.py | test_start_server_already_running | assert | bool_literal | 38 | import asyncio
from contextlib import AsyncExitStack
from datetime import datetime, timedelta
from unittest.mock import AsyncMock, Mock, patch
import pytest
from code_puppy.mcp_.async_lifecycle import (
AsyncServerLifecycleManager,
ManagedServerContext,
get_lifecycle_manager,
)
class TestAsyncServerLifec... | True | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/mcp/test_blocking_startup.py | test_initialization_with_custom_params | assert | bool_literal | 28 | import asyncio
import os
import tempfile
import uuid
from unittest.mock import AsyncMock, patch
import pytest
from code_puppy.mcp_.blocking_startup import (
BlockingMCPServerStdio,
SimpleCapturedMCPServerStdio,
StartupMonitor,
StderrFileCapture,
)
class TestStderrFileCapture:
def test_initializa... | True | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/mcp/test_blocking_startup_coverage.py | test_wait_all_ready_reports_correct_counts | assert | bool_literal | 49 | import os
import tempfile
import threading
import time
import uuid
from contextlib import asynccontextmanager
from unittest.mock import AsyncMock, Mock, patch
import pytest
from code_puppy.mcp_.blocking_startup import (
BlockingMCPServerStdio,
SimpleCapturedMCPServerStdio,
StartupMonitor,
StderrFileCa... | True | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/plugins/test_chatgpt_oauth_core.py | test_save_tokens_file_permissions | assert | complex_expr | 73 | import base64
import hashlib
import json
import time
from unittest.mock import Mock, patch
import pytest
import requests
from code_puppy.plugins.chatgpt_oauth.utils import (
OAuthContext,
_compute_code_challenge,
_generate_code_verifier,
_urlsafe_b64encode,
get_valid_access_token,
load_stored_... | 0o600 | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/mcp/test_dashboard.py | test_render_server_row_with_all_data | assert | complex_expr | 30 | from datetime import datetime, timedelta
from unittest.mock import MagicMock, Mock, patch
from rich.console import Console
from rich.table import Table
from code_puppy.mcp_.dashboard import MCPDashboard
from code_puppy.mcp_.status_tracker import ServerState
class TestRenderServerRow:
def test_render_server_row_... | row[2] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/command_line/mcp/test_mcp_utils.py | test_no_servers_registered | assert | complex_expr | 26 | from unittest.mock import MagicMock, patch
from rich.text import Text
from code_puppy.command_line.mcp.utils import (
find_server_id_by_name,
format_state_indicator,
format_uptime,
suggest_similar_servers,
)
from code_puppy.mcp_.managed_server import ServerState
class TestSuggestSimilarServers:
... | args[0] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/command_line/test_utils_coverage.py | test_calls_ctypes_on_windows | assert_* | complex_expr | 25 | import sys
from unittest.mock import MagicMock, patch
import pytest
class TestResetWindowsConsole:
def test_calls_ctypes_on_windows(self):
"""On Windows, function calls ctypes to reset console mode."""
from code_puppy.command_line.utils import _reset_windows_console
# Mock ctypes module
... | 0x0007) | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/mcp/test_mcp_logs.py | test_write_and_read_logs | assert | complex_expr | 49 | from pathlib import Path
from unittest.mock import patch
import pytest
from code_puppy.mcp_.mcp_logs import (
MAX_LOG_SIZE,
clear_logs,
get_log_stats,
get_mcp_logs_dir,
list_servers_with_logs,
read_logs,
rotate_log_if_needed,
write_log,
)
def temp_logs_dir(tmp_path):
"""Create a t... | logs[0] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/mcp/test_mcp_logs.py | test_write_and_read_logs | assert | complex_expr | 51 | from pathlib import Path
from unittest.mock import patch
import pytest
from code_puppy.mcp_.mcp_logs import (
MAX_LOG_SIZE,
clear_logs,
get_log_stats,
get_mcp_logs_dir,
list_servers_with_logs,
read_logs,
rotate_log_if_needed,
write_log,
)
def temp_logs_dir(tmp_path):
"""Create a t... | logs[1] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/mcp/test_mcp_logs.py | test_read_logs_with_limit | assert | complex_expr | 50 | from pathlib import Path
from unittest.mock import patch
import pytest
from code_puppy.mcp_.mcp_logs import (
MAX_LOG_SIZE,
clear_logs,
get_log_stats,
get_mcp_logs_dir,
list_servers_with_logs,
read_logs,
rotate_log_if_needed,
write_log,
)
def temp_logs_dir(tmp_path):
"""Create a t... | logs[2] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/agents/test_agent_manager_basics.py | test_session_data_handles_corrupted_file | assert | collection | 52 | import importlib
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from code_puppy.agents.agent_manager import (
_AGENT_REGISTRY,
_discover_agents,
_load_session_data,
_save_session_data,
get_available_agents,
get_current_agent,
get_terminal_... | {} | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/agents/test_agent_manager_sessions.py | test_cleanup_empty_dict | assert | collection | 25 | import json
import os
import platform
from pathlib import Path
from unittest.mock import patch
import pytest
from code_puppy.agents.agent_manager import (
_cleanup_dead_sessions,
_ensure_session_cache_loaded,
_get_session_file_path,
_is_process_alive,
_load_session_data,
_save_session_data,
... | {} | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/agents/test_base_agent_configuration.py | test_load_mcp_servers_disabled | assert | collection | 18 | from unittest.mock import MagicMock, patch
import pytest
from code_puppy.agents.agent_code_puppy import CodePuppyAgent
class TestBaseAgentConfiguration:
def agent(self):
return CodePuppyAgent()
def test_load_mcp_servers_disabled(self, agent):
# Test when MCP is disabled
with patch("... | [] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/agents/test_base_agent_edge_cases.py | test_filter_huge_messages_with_empty_list | assert | collection | 22 | from unittest.mock import MagicMock, patch
import pytest
from pydantic_ai import BinaryContent, DocumentUrl, ImageUrl
from pydantic_ai.messages import (
ModelRequest,
TextPart,
)
from code_puppy.agents.agent_code_puppy import CodePuppyAgent
class TestBaseAgentEdgeCases:
def agent(self):
"""Creat... | [] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/agents/test_base_agent_message_processing.py | test_prune_interrupted_tool_calls_empty_list | assert | collection | 28 | import pytest
from pydantic_ai import BinaryContent
from pydantic_ai.messages import (
ModelRequest,
ModelResponse,
TextPart,
ThinkingPart,
ToolCallPart,
ToolReturnPart,
)
from code_puppy.agents.agent_code_puppy import CodePuppyAgent
class TestBaseAgentMessageProcessing:
def agent(self):
... | [] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/agents/test_base_agent_run_mcp.py | test_run_with_mcp_with_dbos_and_mcp_servers | assert | collection | 39 | import asyncio
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from pydantic_ai import BinaryContent, DocumentUrl, ImageUrl
from code_puppy.agents.agent_code_puppy import CodePuppyAgent
class TestBaseAgentRunMCP:
def agent(self):
"""Create a CodePuppyAgent instance for testing."""
... | [] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/agents/test_base_agent_token_estimation.py | test_mcp_tool_cache_initialized_empty | assert | collection | 22 | import math
import pytest
from pydantic_ai.messages import (
ModelRequest,
ModelResponse,
TextPart,
)
from code_puppy.agents.agent_code_puppy import CodePuppyAgent
class TestMCPToolCache:
def agent(self):
"""Provide a concrete BaseAgent subclass for testing."""
return CodePuppyAgent(... | [] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/agents/test_json_agent_extended.py | test_discover_no_agents_directory | assert | collection | 17 | import json
from unittest.mock import patch
import pytest
from code_puppy.agents.json_agent import JSONAgent, discover_json_agents
class TestDiscoverJsonAgents:
def test_discover_no_agents_directory(self):
"""Test discovery when agents directory doesn't exist."""
with patch("code_puppy.config.ge... | {} | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/command_line/test_agent_menu.py | test_returns_empty_list_when_no_agents | assert | collection | 32 | from unittest.mock import patch
from code_puppy.command_line.agent_menu import (
PAGE_SIZE,
_apply_pinned_model,
_get_agent_entries,
_get_pinned_model,
_render_menu_panel,
_render_preview_panel,
)
def _get_text_from_formatted(result):
"""Extract plain text from formatted text control outpu... | [] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/command_line/test_autosave_menu.py | test_handles_missing_file | assert | collection | 25 | import json
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from code_puppy.command_line.autosave_menu import (
PAGE_SIZE,
_extract_last_user_message,
_extract_message_content,
_get_session_entries,
_get_session_metadata,
_render_menu_panel,
_re... | {} | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/command_line/test_clipboard.py | test_clear_pending_removes_all_images | assert | collection | 22 | import io
import threading
from unittest.mock import MagicMock, patch
class TestClipboardAttachmentManager:
def test_clear_pending_removes_all_images(self):
"""Test that clear_pending removes all pending images."""
from code_puppy.command_line.clipboard import ClipboardAttachmentManager
m... | [] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/command_line/test_uc_menu.py | test_handles_missing_file | assert | collection | 64 | import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from code_puppy.command_line.uc_menu import (
PAGE_SIZE,
_get_tool_entries,
_render_menu_panel,
_render_preview_panel,
_sanitize_display_text,
_show_source_code,
_toggle_tool_enable... | [] | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/test_model_factory.py | test_ollama_load_model | assert | func_call | 21 | import os
from unittest.mock import patch
import pytest
from code_puppy.model_factory import ModelFactory
TEST_CONFIG_PATH = os.path.join(os.path.dirname(__file__), "../code_puppy/models.json")
def test_ollama_load_model():
config = ModelFactory.load_config()
# Skip test if 'ollama-llama2' model is not in ... | dir(model) | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/test_session_storage.py | test_save_and_load_session | assert | func_call | 36 | from __future__ import annotations
import json
import os
from pathlib import Path
from typing import Callable, List
import pytest
from code_puppy.session_storage import (
cleanup_sessions,
list_sessions,
load_session,
save_session,
)
def history() -> List[str]:
return ["one", "two", "three"]
de... | len(history) | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mpfaffenberger/code_puppy | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | train | train | tests/plugins/test_customizable_commands_callbacks.py | test_returns_sorted_entries | assert | func_call | 33 | import tempfile
from pathlib import Path
from unittest.mock import patch
from code_puppy.plugins.customizable_commands.register_callbacks import (
MarkdownCommandResult,
_command_descriptions,
_custom_commands,
_custom_help,
_generate_unique_command_name,
_handle_custom_command,
_load_markd... | sorted(names) | 0686346c4a9c91fa055f6d154bb97944a092fa73 | 225 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/core/test_base_router.py | test_add_route | assert | numeric_literal | 32 | from unittest.mock import MagicMock
import pytest
from fastopenapi.core.router import BaseRouter, RouteInfo
class TestBaseRouter:
def setup_method(self):
self.app_mock = MagicMock()
# Create router instance with overridden _register_docs_endpoints method
class TestRouter(BaseRouter):
... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/core/test_base_router.py | test_get_routes | assert | numeric_literal | 35 | from unittest.mock import MagicMock
import pytest
from fastopenapi.core.router import BaseRouter, RouteInfo
class TestBaseRouter:
def setup_method(self):
self.app_mock = MagicMock()
# Create router instance with overridden _register_docs_endpoints method
class TestRouter(BaseRouter):
... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/core/test_base_router.py | test_http_method_decorators | assert | numeric_literal | 59 | from unittest.mock import MagicMock
import pytest
from fastopenapi.core.router import BaseRouter, RouteInfo
class TestBaseRouter:
def setup_method(self):
self.app_mock = MagicMock()
# Create router instance with overridden _register_docs_endpoints method
class TestRouter(BaseRouter):
... | 7 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/core/test_dependency_resolver.py | test_resolve_dependencies_without_caching | assert | numeric_literal | 51 | import threading
import time
from unittest.mock import Mock, patch
from weakref import WeakKeyDictionary
import pytest
from fastopenapi.core.dependency_resolver import (
DependencyResolver,
get_dependency_stats,
resolve_dependencies,
)
from fastopenapi.core.params import Depends, Security
from fastopenapi... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/core/test_dependency_resolver.py | test_resolve_dependencies_without_caching | assert | numeric_literal | 56 | import threading
import time
from unittest.mock import Mock, patch
from weakref import WeakKeyDictionary
import pytest
from fastopenapi.core.dependency_resolver import (
DependencyResolver,
get_dependency_stats,
resolve_dependencies,
)
from fastopenapi.core.params import Depends, Security
from fastopenapi... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/core/test_dependency_resolver.py | test_get_cache_stats_empty | assert | numeric_literal | 41 | import threading
import time
from unittest.mock import Mock, patch
from weakref import WeakKeyDictionary
import pytest
from fastopenapi.core.dependency_resolver import (
DependencyResolver,
get_dependency_stats,
resolve_dependencies,
)
from fastopenapi.core.params import Depends, Security
from fastopenapi... | 0 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/openapi/test_openapi_generator.py | test_parameter_with_constraints | assert | numeric_literal | 52 | import inspect
import threading
from typing import Any, Optional, Union
from unittest.mock import Mock, patch
from pydantic import BaseModel, Field
from fastopenapi.core.constants import SecuritySchemeType
from fastopenapi.core.params import Body, Depends, File, Form, Header, Query, Security
from fastopenapi.core.rou... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/openapi/test_openapi_generator.py | test_parameter_with_examples | assert | numeric_literal | 45 | import inspect
import threading
from typing import Any, Optional, Union
from unittest.mock import Mock, patch
from pydantic import BaseModel, Field
from fastopenapi.core.constants import SecuritySchemeType
from fastopenapi.core.params import Body, Depends, File, Form, Header, Query, Security
from fastopenapi.core.rou... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/openapi/test_openapi_generator.py | test_security_dependency | assert | numeric_literal | 51 | import inspect
import threading
from typing import Any, Optional, Union
from unittest.mock import Mock, patch
from pydantic import BaseModel, Field
from fastopenapi.core.constants import SecuritySchemeType
from fastopenapi.core.params import Body, Depends, File, Form, Header, Query, Security
from fastopenapi.core.rou... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/openapi/test_openapi_generator.py | test_schema_builder_apply_metadata_constraints_with_constraints | assert | numeric_literal | 62 | import inspect
import threading
from typing import Any, Optional, Union
from unittest.mock import Mock, patch
from pydantic import BaseModel, Field
from fastopenapi.core.constants import SecuritySchemeType
from fastopenapi.core.params import Body, Depends, File, Form, Header, Query, Security
from fastopenapi.core.rou... | 5 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/openapi/test_openapi_generator.py | test_schema_builder_apply_metadata_constraints_with_constraints | assert | numeric_literal | 64 | import inspect
import threading
from typing import Any, Optional, Union
from unittest.mock import Mock, patch
from pydantic import BaseModel, Field
from fastopenapi.core.constants import SecuritySchemeType
from fastopenapi.core.params import Body, Depends, File, Form, Header, Query, Security
from fastopenapi.core.rou... | 0 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/resolution/test_parameter_resolver.py | test_process_numeric_constraints_gt | assert | numeric_literal | 50 | import inspect
from unittest.mock import MagicMock, Mock, patch
import pytest
from pydantic import BaseModel, Field
from pydantic_core import PydanticUndefined
from fastopenapi.core.constants import ParameterSource
from fastopenapi.core.params import (
Body,
Cookie,
Depends,
File,
Form,
Header... | 0 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/resolution/test_parameter_resolver.py | test_process_numeric_constraints_multiple_of | assert | numeric_literal | 52 | import inspect
from unittest.mock import MagicMock, Mock, patch
import pytest
from pydantic import BaseModel, Field
from pydantic_core import PydanticUndefined
from fastopenapi.core.constants import ParameterSource
from fastopenapi.core.params import (
Body,
Cookie,
Depends,
File,
Form,
Header... | 5 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/resolution/test_parameter_resolver.py | test_process_float_decimal_constraints | assert | numeric_literal | 54 | import inspect
from unittest.mock import MagicMock, Mock, patch
import pytest
from pydantic import BaseModel, Field
from pydantic_core import PydanticUndefined
from fastopenapi.core.constants import ParameterSource
from fastopenapi.core.params import (
Body,
Cookie,
Depends,
File,
Form,
Header... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/resolution/test_parameter_resolver.py | test_get_or_create_validation_model_caching | assert | numeric_literal | 67 | import inspect
from unittest.mock import MagicMock, Mock, patch
import pytest
from pydantic import BaseModel, Field
from pydantic_core import PydanticUndefined
from fastopenapi.core.constants import ParameterSource
from fastopenapi.core.params import (
Body,
Cookie,
Depends,
File,
Form,
Header... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/response/test_response_builder.py | test_serialize_pydantic_model | assert | numeric_literal | 19 | from pydantic import BaseModel
from fastopenapi.core.types import Response
from fastopenapi.response.builder import ResponseBuilder
class TestResponseBuilder:
def setup_method(self):
self.builder = ResponseBuilder()
def test_serialize_pydantic_model(self):
# Test serializing a Pydantic model ... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/response/test_response_builder.py | test_serialize_list_of_models | assert | numeric_literal | 22 | from pydantic import BaseModel
from fastopenapi.core.types import Response
from fastopenapi.response.builder import ResponseBuilder
class TestResponseBuilder:
def setup_method(self):
self.builder = ResponseBuilder()
def test_serialize_list_of_models(self):
# Test serializing a list of Pydanti... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/response/test_response_builder.py | test_serialize_primitives | assert | numeric_literal | 13 | from pydantic import BaseModel
from fastopenapi.core.types import Response
from fastopenapi.response.builder import ResponseBuilder
class TestResponseBuilder:
def setup_method(self):
self.builder = ResponseBuilder()
def test_serialize_primitives(self):
# Test serializing primitive values
... | 5 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/aiohttp/test_aiohttp_extractor.py | test_get_files_multiple_files_same_name | assert | numeric_literal | 50 | from unittest.mock import AsyncMock, Mock
import pytest
from fastopenapi.core.types import RequestData
from fastopenapi.routers.aiohttp.extractors import AioHttpRequestDataExtractor
from fastopenapi.routers.common import RequestEnvelope
class TestAioHttpRequestDataExtractor:
@pytest.mark.asyncio
async def t... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/aiohttp/test_aiohttp_integration.py | test_get_items | assert | numeric_literal | 12 | import pytest
from pydantic_core import to_json
class TestAioHttpIntegration:
@pytest.mark.asyncio
async def test_get_items(self, client):
"""Test retrieving all items"""
resp = await client.get("/items")
assert resp.status == 200
data = await resp.json()
assert len(dat... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/aiohttp/test_aiohttp_integration.py | test_get_item | assert | numeric_literal | 13 | import pytest
from pydantic_core import to_json
class TestAioHttpIntegration:
@pytest.mark.asyncio
async def test_get_item(self, client):
"""Test retrieving item by ID"""
resp = await client.get("/items/1")
assert resp.status == 200
data = await resp.json()
assert data... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/aiohttp/test_aiohttp_integration.py | test_create_item | assert | numeric_literal | 17 | import pytest
from pydantic_core import to_json
class TestAioHttpIntegration:
@pytest.mark.asyncio
async def test_create_item(self, client):
"""Test creating an item"""
new_item = {"name": "New Item", "description": "New Description"}
headers = {"Content-Type": "application/json"}
... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/aiohttp/test_aiohttp_router.py | test_add_route | assert | numeric_literal | 25 | from collections.abc import Awaitable
from aiohttp import web
from pydantic import BaseModel
from fastopenapi.routers import AioHttpRouter
class TestAioHttpRouter:
def test_add_route(self, event_loop):
"""Test adding a route"""
app = web.Application()
router = AioHttpRouter(app=app)
... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/django/async_router/test_django_integration.py | test_get_items | assert | numeric_literal | 12 | import pytest
class TestAsyncDjangoIntegration:
@pytest.mark.asyncio
async def test_get_items(self, client):
"""Test fetching all items"""
response = await client.get("/items")
assert response.status_code == 200
result = response.json()
assert len(result) == | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/django/async_router/test_django_integration.py | test_get_item | assert | numeric_literal | 13 | import pytest
class TestAsyncDjangoIntegration:
@pytest.mark.asyncio
async def test_get_item(self, client):
"""Test fetching an item by ID"""
response = await client.get("/items/1")
assert response.status_code == 200
result = response.json()
assert result["id"] == | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/django/async_router/test_django_integration.py | test_create_item | assert | numeric_literal | 16 | import pytest
class TestAsyncDjangoIntegration:
@pytest.mark.asyncio
async def test_create_item(self, client):
"""Test creating an item"""
new_item = {"name": "New Item", "description": "New Description"}
response = await client.post(
"/items", new_item, content_type="appli... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/django/async_router/test_django_router.py | test_add_route | assert | numeric_literal | 18 | from pydantic import BaseModel
from fastopenapi.routers import DjangoAsyncRouter
class TestDjangoAsyncRouter:
def test_add_route(self):
"""Test adding a route"""
router = DjangoAsyncRouter(app=True)
def test_endpoint():
return {"message": "Test"}
router.add_route("/t... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/django/sync_router/test_django_extractor.py | test_get_files_multiple_files_same_key | assert | numeric_literal | 31 | from unittest.mock import Mock
from fastopenapi.core.types import RequestData
from fastopenapi.routers.common import RequestEnvelope
from fastopenapi.routers.django.extractors import DjangoRequestDataExtractor
class TestDjangoRequestDataExtractor:
def test_get_files_multiple_files_same_key(self):
"""Test... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/django/sync_router/test_django_extractor.py | test_get_files_multiple_keys | assert | numeric_literal | 33 | from unittest.mock import Mock
from fastopenapi.core.types import RequestData
from fastopenapi.routers.common import RequestEnvelope
from fastopenapi.routers.django.extractors import DjangoRequestDataExtractor
class TestDjangoRequestDataExtractor:
def test_get_files_multiple_keys(self):
"""Test files ext... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/django/sync_router/test_django_integration.py | test_get_items | assert | numeric_literal | 11 | import pytest
class TestDjangoIntegration:
def test_get_items(self, client):
"""Test fetching all items"""
response = client.get("/items")
assert response.status_code == 200
result = response.json()
assert len(result) == | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/django/sync_router/test_django_integration.py | test_get_item | assert | numeric_literal | 12 | import pytest
class TestDjangoIntegration:
def test_get_item(self, client):
"""Test fetching an item by ID"""
response = client.get("/items/1")
assert response.status_code == 200
result = response.json()
assert result["id"] == | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/django/sync_router/test_django_integration.py | test_create_item | assert | numeric_literal | 13 | import pytest
class TestDjangoIntegration:
def test_create_item(self, client):
"""Test creating an item"""
new_item = {"name": "New Item", "description": "New Description"}
response = client.post("/items", new_item, content_type="application/json")
assert response.status_code == 2... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/django/sync_router/test_django_integration.py | test_query_validation_valid | assert | numeric_literal | 12 | import pytest
class TestDjangoIntegration:
def test_query_validation_valid(self, client):
"""Test query parameter validation with valid data"""
response = client.get("/test-query-validation?page=5&limit=20&search=test")
assert response.status_code == 200
result = response.json()
... | 5 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/django/sync_router/test_django_router.py | test_add_route | assert | numeric_literal | 18 | from pydantic import BaseModel
from fastopenapi.routers import DjangoRouter
class TestDjangoRouter:
def test_add_route(self):
"""Test adding a route"""
router = DjangoRouter(app=True)
def test_endpoint():
return {"message": "Test"}
router.add_route("/test", "GET", te... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/falcon/async_router/test_falcon_integration.py | test_get_items_sync | assert | numeric_literal | 13 | import pytest
from pydantic_core import from_json, to_json
class TestFalconIntegration:
def test_get_items_sync(self, sync_client):
"""Test fetching all items synchronously"""
response = sync_client.simulate_get("/items-sync")
assert response.status_code == 200
result = from_json(... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/falcon/async_router/test_falcon_integration.py | test_get_item | assert | numeric_literal | 14 | import pytest
from pydantic_core import from_json, to_json
class TestFalconIntegration:
@pytest.mark.asyncio
async def test_get_item(self, async_client):
"""Test fetching an item by ID"""
response = await async_client.simulate_get("/items/1")
assert response.status_code == 200
... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/falcon/async_router/test_falcon_integration.py | test_create_item | assert | numeric_literal | 19 | import pytest
from pydantic_core import from_json, to_json
class TestFalconIntegration:
@pytest.mark.asyncio
async def test_create_item(self, async_client):
"""Test creating an item"""
new_item = {"name": "New Item", "description": "New Description"}
response = await async_client.simul... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/falcon/async_router/test_falcon_router.py | test_add_route | assert | numeric_literal | 20 | import falcon.asgi
from pydantic import BaseModel
from fastopenapi.routers import FalconAsyncRouter
class TestFalconAsyncRouter:
def test_add_route(self):
"""Test adding a route"""
app = falcon.asgi.App()
router = FalconAsyncRouter(app=app)
async def test_endpoint():
... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/falcon/sync_router/test_falcon_extractor.py | test_get_files_skip_fields_without_filename | assert | numeric_literal | 30 | import json
from unittest.mock import Mock
from falcon import testing
from fastopenapi.routers.falcon.extractors import FalconRequestDataExtractor
class TestFalconRequestDataExtractor:
def test_get_files_skip_fields_without_filename(self):
"""Test that form fields without filename are skipped"""
... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/falcon/sync_router/test_falcon_extractor.py | test_get_files_multiple_files_creates_list | assert | numeric_literal | 30 | import json
from unittest.mock import Mock
from falcon import testing
from fastopenapi.routers.falcon.extractors import FalconRequestDataExtractor
class TestFalconRequestDataExtractor:
def test_get_files_multiple_files_creates_list(self):
"""Test that multiple files with same field name create a list"""... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/falcon/sync_router/test_falcon_integration.py | test_get_items | assert | numeric_literal | 13 | import pytest
from pydantic_core import from_json, to_json
class TestFalconIntegration:
def test_get_items(self, sync_client):
"""Test fetching all items"""
response = sync_client.simulate_get("/items")
assert response.status_code == 200
result = from_json(response.text)
... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/falcon/sync_router/test_falcon_integration.py | test_get_item | assert | numeric_literal | 13 | import pytest
from pydantic_core import from_json, to_json
class TestFalconIntegration:
def test_get_item(self, sync_client):
"""Test fetching an item by ID"""
response = sync_client.simulate_get("/items/1")
assert response.status_code == 200
result = from_json(response.text)
... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/falcon/sync_router/test_falcon_integration.py | test_create_item | assert | numeric_literal | 18 | import pytest
from pydantic_core import from_json, to_json
class TestFalconIntegration:
def test_create_item(self, sync_client):
"""Test creating an item"""
new_item = {"name": "New Item", "description": "New Description"}
response = sync_client.simulate_post(
"/items",
... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/falcon/sync_router/test_falcon_router.py | test_add_route | assert | numeric_literal | 20 | from falcon import App
from pydantic import BaseModel
from fastopenapi.routers import FalconRouter
class TestFalconRouter:
def test_add_route(self):
"""Test adding a route"""
app = App()
router = FalconRouter(app=app)
def test_endpoint():
return {"message": "Test"}
... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/flask/test_flask_extractor.py | test_get_files_multiple_files_same_key | assert | numeric_literal | 37 | import json
from io import BytesIO
from flask import Flask, request
from fastopenapi.core.types import RequestData
from fastopenapi.routers.common import RequestEnvelope
from fastopenapi.routers.flask.extractors import FlaskRequestDataExtractor
class TestFlaskRequestDataExtractor:
def create_app():
"""H... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/flask/test_flask_extractor.py | test_get_files_multiple_keys | assert | numeric_literal | 32 | import json
from io import BytesIO
from flask import Flask, request
from fastopenapi.core.types import RequestData
from fastopenapi.routers.common import RequestEnvelope
from fastopenapi.routers.flask.extractors import FlaskRequestDataExtractor
class TestFlaskRequestDataExtractor:
def create_app():
"""H... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/flask/test_flask_integration.py | test_get_items | assert | numeric_literal | 13 | import pytest
from pydantic_core import from_json, to_json
class TestFlaskIntegration:
def test_get_items(self, client):
"""Test fetching all items"""
response = client.get("/items")
assert response.status_code == 200
result = from_json(response.text)
assert len(result) =... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/flask/test_flask_integration.py | test_get_item | assert | numeric_literal | 13 | import pytest
from pydantic_core import from_json, to_json
class TestFlaskIntegration:
def test_get_item(self, client):
"""Test fetching an item by ID"""
response = client.get("/items/1")
assert response.status_code == 200
result = from_json(response.text)
assert result["... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/flask/test_flask_integration.py | test_create_item | assert | numeric_literal | 18 | import pytest
from pydantic_core import from_json, to_json
class TestFlaskIntegration:
def test_create_item(self, client):
"""Test creating an item"""
new_item = {"name": "New Item", "description": "New Description"}
response = client.post(
"/items",
data=to_json(ne... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/flask/test_flask_router.py | test_add_route | assert | numeric_literal | 20 | from flask import Flask
from pydantic import BaseModel
from fastopenapi.routers import FlaskRouter
class TestFlaskRouter:
def test_add_route(self):
"""Test adding a route"""
app = Flask(__name__)
router = FlaskRouter(app=app)
async def test_endpoint():
return {"messag... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/quart/test_quart_extractor.py | test_get_files_multiple_same_name | assert | numeric_literal | 51 | import json
from io import BytesIO
from unittest.mock import Mock
import pytest
from quart import Quart, request
from fastopenapi.core.types import RequestData
from fastopenapi.routers.common import RequestEnvelope
from fastopenapi.routers.quart.extractors import QuartRequestDataExtractor
class TestQuartRequestDataE... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/quart/test_quart_integration.py | test_get_items | assert | numeric_literal | 14 | import pytest
from pydantic_core import to_json
class TestQuartIntegration:
@pytest.mark.asyncio
async def test_get_items(self, client):
"""Test fetching all items"""
response = await client.get("/items")
assert response.status_code == 200
result = await response.get_json()
... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/quart/test_quart_integration.py | test_get_item | assert | numeric_literal | 14 | import pytest
from pydantic_core import to_json
class TestQuartIntegration:
@pytest.mark.asyncio
async def test_get_item(self, client):
"""Test fetching an item by ID"""
response = await client.get("/items/1")
assert response.status_code == 200
result = await response.get_json... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/quart/test_quart_integration.py | test_create_item | assert | numeric_literal | 19 | import pytest
from pydantic_core import to_json
class TestQuartIntegration:
@pytest.mark.asyncio
async def test_create_item(self, client):
"""Test creating an item"""
new_item = {"name": "New Item", "description": "New Description"}
response = await client.post(
"/items",
... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/quart/test_quart_router.py | test_add_route | assert | numeric_literal | 20 | from pydantic import BaseModel
from quart import Quart
from fastopenapi.routers import QuartRouter
class TestQuartRouter:
def test_add_route(self):
"""Test adding a route"""
app = Quart(__name__)
router = QuartRouter(app=app)
async def test_endpoint():
return {"messag... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/sanic/test_sanic_extractor.py | test_get_files_multiple_files_same_key | assert | numeric_literal | 34 | from unittest.mock import Mock
import pytest
from fastopenapi.core.types import RequestData
from fastopenapi.routers.common import RequestEnvelope
from fastopenapi.routers.sanic.extractors import SanicRequestDataExtractor
class TestSanicRequestDataExtractor:
@pytest.mark.asyncio
async def test_get_files_mul... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/sanic/test_sanic_extractor.py | test_get_files_multiple_keys | assert | numeric_literal | 36 | from unittest.mock import Mock
import pytest
from fastopenapi.core.types import RequestData
from fastopenapi.routers.common import RequestEnvelope
from fastopenapi.routers.sanic.extractors import SanicRequestDataExtractor
class TestSanicRequestDataExtractor:
@pytest.mark.asyncio
async def test_get_files_mul... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/sanic/test_sanic_integration.py | test_get_items | assert | numeric_literal | 14 | import pytest
from pydantic_core import from_json, to_json
class TestSanicIntegration:
@pytest.mark.asyncio
async def test_get_items(self, client):
"""Test fetching all items"""
_, response = await client.get("/items")
assert response.status_code == 200
result = from_json(resp... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/sanic/test_sanic_integration.py | test_get_item | assert | numeric_literal | 14 | import pytest
from pydantic_core import from_json, to_json
class TestSanicIntegration:
@pytest.mark.asyncio
async def test_get_item(self, client):
"""Test fetching an item by ID"""
_, response = await client.get("/items/1")
assert response.status_code == 200
result = from_json... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/sanic/test_sanic_integration.py | test_create_item | assert | numeric_literal | 19 | import pytest
from pydantic_core import from_json, to_json
class TestSanicIntegration:
@pytest.mark.asyncio
async def test_create_item(self, client):
"""Test creating an item"""
new_item = {"name": "New Item", "description": "New Description"}
_, response = await client.post(
... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/sanic/test_sanic_router.py | test_add_route | assert | numeric_literal | 20 | from pydantic import BaseModel
from sanic import Sanic
from fastopenapi.routers import SanicRouter
class TestSanicRouter:
def test_add_route(self):
"""Test adding a route"""
app = Sanic("SanicTestApp")
router = SanicRouter(app=app)
async def test_endpoint():
return {"... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/starlette/test_starlette_extractor.py | test_get_files_multiple_files_same_key | assert | numeric_literal | 49 | from unittest.mock import AsyncMock, Mock
import pytest
from fastopenapi.core.types import RequestData
from fastopenapi.routers.common import RequestEnvelope
from fastopenapi.routers.starlette.extractors import StarletteRequestDataExtractor
class TestStarletteRequestDataExtractor:
@pytest.mark.asyncio
async... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/starlette/test_starlette_extractor.py | test_get_files_mixed_form_data | assert | numeric_literal | 41 | from unittest.mock import AsyncMock, Mock
import pytest
from fastopenapi.core.types import RequestData
from fastopenapi.routers.common import RequestEnvelope
from fastopenapi.routers.starlette.extractors import StarletteRequestDataExtractor
class TestStarletteRequestDataExtractor:
@pytest.mark.asyncio
async... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/starlette/test_starlette_integration.py | test_get_items | assert | numeric_literal | 14 | import pytest
from pydantic_core import from_json, to_json
class TestStarletteIntegration:
@pytest.mark.asyncio
async def test_get_items(self, client):
"""Test fetching all items"""
response = client.get("/items")
assert response.status_code == 200
result = from_json(response.... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/starlette/test_starlette_integration.py | test_get_item | assert | numeric_literal | 14 | import pytest
from pydantic_core import from_json, to_json
class TestStarletteIntegration:
@pytest.mark.asyncio
async def test_get_item(self, client):
"""Test fetching an item by ID"""
response = client.get("/items/1")
assert response.status_code == 200
result = from_json(resp... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/starlette/test_starlette_integration.py | test_create_item | assert | numeric_literal | 19 | import pytest
from pydantic_core import from_json, to_json
class TestStarletteIntegration:
@pytest.mark.asyncio
async def test_create_item(self, client):
"""Test creating an item"""
new_item = {"name": "New Item", "description": "New Description"}
response = client.post(
"/... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/starlette/test_starlette_router.py | test_add_route | assert | numeric_literal | 20 | from pydantic import BaseModel
from starlette.applications import Starlette
from fastopenapi.routers import StarletteRouter
class TestStarletteRouter:
def test_add_route(self):
"""Test adding a route"""
app = Starlette()
router = StarletteRouter(app=app)
async def test_endpoint()... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/test_base_adapter.py | test_cache_thread_safety | assert | numeric_literal | 34 | import threading
import pytest
from pydantic import BaseModel, TypeAdapter
from fastopenapi.errors.exceptions import InternalServerError
from fastopenapi.routers.base import BaseAdapter
class TestTypeAdapterCache:
def test_cache_thread_safety(self):
"""Cache works correctly under multithreading"""
... | 0 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/test_base_adapter.py | test_cache_thread_safety | assert | numeric_literal | 37 | import threading
import pytest
from pydantic import BaseModel, TypeAdapter
from fastopenapi.errors.exceptions import InternalServerError
from fastopenapi.routers.base import BaseAdapter
class TestTypeAdapterCache:
def test_cache_thread_safety(self):
"""Cache works correctly under multithreading"""
... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/test_base_adapter.py | test_validate_list_of_models | assert | numeric_literal | 19 | import threading
import pytest
from pydantic import BaseModel, TypeAdapter
from fastopenapi.errors.exceptions import InternalServerError
from fastopenapi.routers.base import BaseAdapter
class TestResponseValidation:
def test_validate_list_of_models(self):
"""Validation of a list of models via TypeAdapte... | 2 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/tornado/test_dynamic_handler.py | test_json_content_with_explicit_content_type | assert | numeric_literal | 58 | from unittest.mock import AsyncMock, MagicMock
import pytest
import tornado.web
from fastopenapi.routers.tornado.handler import TornadoDynamicHandler
class TestTornadoDynamicHandler:
def mock_request(self):
request = MagicMock()
request.query_arguments = {}
request.body = None
re... | 1 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/tornado/test_tornado_extractor.py | test_get_files_multiple_files_same_key | assert | numeric_literal | 40 | from unittest.mock import Mock
import pytest
from fastopenapi.core.types import RequestData
from fastopenapi.routers.common import RequestEnvelope
from fastopenapi.routers.tornado.extractors import TornadoRequestDataExtractor
class TestTornadoRequestDataExtractor:
@pytest.mark.asyncio
async def test_get_fil... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/tornado/test_tornado_router.py | test_init_with_app_and_docs | assert | numeric_literal | 50 | import re
import pytest
import tornado.web
from fastopenapi.routers import TornadoRouter
def dummy_endpoint(**kwargs):
return "ok"
def dummy_app():
return tornado.web.Application()
class TestTornadoRouter:
def router(self, dummy_app):
"""Router fixture without automatic documentation endpoints... | 3 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/routers/tornado/test_tornado_router.py | test_init_without_app | assert | numeric_literal | 54 | import re
import pytest
import tornado.web
from fastopenapi.routers import TornadoRouter
def dummy_endpoint(**kwargs):
return "ok"
def dummy_app():
return tornado.web.Application()
class TestTornadoRouter:
def router(self, dummy_app):
"""Router fixture without automatic documentation endpoints... | 0 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
mr-fatalyst/fastopenapi | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | train | train | tests/openapi/test_openapi_generator.py | test_parameter_with_constraints | assert | numeric_literal | 53 | import inspect
import threading
from typing import Any, Optional, Union
from unittest.mock import Mock, patch
from pydantic import BaseModel, Field
from fastopenapi.core.constants import SecuritySchemeType
from fastopenapi.core.params import Body, Depends, File, Form, Header, Query, Security
from fastopenapi.core.rou... | 50 | 60c6094b2373456d4d993caaed4279c1f209bc3d | 26 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.