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 |
|---|---|---|---|---|---|---|---|---|---|
shotgun-sh/shotgun | import pytest
from pydantic_ai import RunContext
from shotgun.agents.models import AgentDeps
from shotgun.agents.tools.codebase import codebase_shell
from shotgun.codebase.models import CodebaseGraph
@pytest.mark.integration
@pytest.mark.asyncio
async def test_codebase_shell_empty_command(
indexed_graph: Codebase... | "" | assert | string_literal | test/integration/codebase/tools/test_codebase_shell.py | test_codebase_shell_empty_command | 357 | null | |
shotgun-sh/shotgun | import multiprocessing
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from shotgun.codebase.core.ingestor import SimpleGraphBuilder
from shotgun.codebase.core.parser_loader import load_parsers
from shotgun.settings import settings
def sample_repo() -> Path:
"""C... | 0 | assert | numeric_literal | test/integration/codebase/test_indexer_integration.py | test_build_file_infos_creates_correct_objects | 203 | null | |
shotgun-sh/shotgun | from shotgun.agents.config.models import ModelName
from shotgun.agents.context_analyzer.models import ContextAnalysis, MessageTypeStats
from shotgun.tui.components.context_indicator import ContextIndicator
def create_test_analysis(
agent_context_tokens: int = 72_000,
max_usable_tokens: int = 160_000,
) -> Cont... | "2K" | assert | string_literal | test/unit/tui/components/test_context_indicator.py | test_context_indicator_format_token_count | 60 | null | |
shotgun-sh/shotgun | from datetime import datetime, timezone
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from shotgun.cli.spec.models import PullSource
from shotgun.cli.spec.pull_service import (
CancelledError,
PullProgress,
SpecPullService,
)
from shotgun.shotgun_web.models i... | "cli" | assert | string_literal | test/unit/cli/spec/test_pull_service.py | test_pull_version_tracks_failure_event | 387 | null | |
shotgun-sh/shotgun | import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import httpx
import pytest
from pydantic import SecretStr
from shotgun.agents.config.manager import ConfigManager
from shotgun.agents.config.models import (
KeyProvider,
ModelName,
OpenAIConfig,
ProviderType... | ModelName.GPT_5_2 | assert | complex_expr | test/unit/test_streaming_detection.py | test_get_provider_model_gpt5_2_byok_not_tested | 193 | null | |
shotgun-sh/shotgun | from pathlib import Path
import pytest
from shotgun.agents.models import (
AgentSystemPromptContext,
FileOperationTracker,
FileOperationType,
)
def test_agent_system_prompt_context_default_capabilities():
"""Test that AgentSystemPromptContext defaults to supporting multimodal."""
context = AgentS... | True | assert | bool_literal | test/unit/agents/test_models.py | test_agent_system_prompt_context_default_capabilities | 169 | null | |
shotgun-sh/shotgun | import json
import tempfile
from pathlib import Path
import pytest
from shotgun.agents.config.manager import (
CURRENT_CONFIG_VERSION,
ConfigManager,
_apply_migrations,
_create_backup,
_migrate_v2_to_v3,
_migrate_v3_to_v4,
_migrate_v4_to_v5,
_migrate_v6_to_v7,
_migrate_v7_to_v8,
... | 3 | assert | numeric_literal | test/unit/test_config_migrations.py | test_migrate_v2_to_v3 | 183 | null | |
shotgun-sh/shotgun | from __future__ import annotations
import multiprocessing
import os
import sys
import tempfile
import threading
import time
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import TimeoutError as FuturesTimeoutError
from pathlib import Path
import psutil
import pytest
from shotgun.codebase.c... | 1 | assert | numeric_literal | test/integration/codebase/test_multiplatform.py | test_worker_count_platform_independent | 52 | null | |
shotgun-sh/shotgun | import json
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from shotgun.agents.config.models import ProviderType
from shotgun.agents.config.tier_detection import (
AnthropicTier,
get_configured_anthropic_tier,
)
from shotgun.agents.conversation import ConversationHistory
def test_tier1_e... | key.lower() | assert | func_call | test/unit/test_tier1_telemetry.py | test_tier1_event_has_no_pii | 209 | null | |
shotgun-sh/shotgun | from shotgun.exceptions import IncompleteToolCallError, UserActionableError
def test_incomplete_tool_call_error_markdown_with_tool_name():
"""to_markdown should include tool name when provided."""
error = IncompleteToolCallError(tool_name="file_read")
md = error.to_markdown()
assert "file_read" in md
... | md.lower() | assert | func_call | test/unit/exceptions/test_incomplete_tool_call.py | test_incomplete_tool_call_error_markdown_with_tool_name | 32 | null | |
shotgun-sh/shotgun | from shotgun.agents.router.models import (
AddStepInput,
CascadeScope,
CreatePlanInput,
DelegationInput,
DelegationResult,
ExecutionPlan,
ExecutionStep,
ExecutionStepInput,
MarkStepDoneInput,
PlanApprovalStatus,
RemoveStepInput,
RouterMode,
StepCheckpointAction,
S... | deps | assert | variable | test/unit/agents/router/test_models.py | test_get_dependent_files_research | 254 | null | |
shotgun-sh/shotgun | from __future__ import annotations
from pathlib import Path
from unittest.mock import patch
import pytest
from shotgun.codebase import CodebaseService, QueryType
from shotgun.codebase.core.metrics_types import (
FileParseTask,
WorkBatch,
)
from shotgun.codebase.core.parallel_executor import ParallelExecutor
... | 3 | assert | numeric_literal | test/integration/codebase/test_error_handling.py | test_sequential_fallback_produces_valid_data | 241 | null | |
shotgun-sh/shotgun | from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from pydantic_ai.messages import (
ModelRequest,
ModelResponse,
TextPart,
UserPromptPart,
)
from pydantic_ai.usage import RequestUsage
from shotgun.agents.conversation.history.compaction import (
apply_persistent_compaction,
)
fro... | 0 | assert | numeric_literal | test/unit/test_compaction.py | testget_last_api_token_count_no_usage | 64 | null | |
shotgun-sh/shotgun | from shotgun.tui.components.update_indicator import UpdateIndicator
from shotgun.utils.update_checker import UpdateInfo
def create_test_update_info(
current_version: str = "0.1.0",
latest_version: str = "0.2.0",
update_available: bool = True,
installation_method: str = "pipx",
) -> UpdateInfo:
"""C... | info | assert | variable | test/unit/tui/components/test_update_indicator.py | test_update_indicator_set_update_info | 55 | null | |
shotgun-sh/shotgun | from __future__ import annotations
from pathlib import Path
import pytest
from shotgun.codebase import CodebaseService, QueryType
from shotgun.codebase.models import GraphStatus, IndexProgress, ProgressPhase
@pytest.mark.integration
@pytest.mark.asyncio
async def test_codebase_index_command_works(
simple_python... | 0 | assert | numeric_literal | test/integration/codebase/test_regression.py | test_codebase_index_command_works | 37 | null | |
shotgun-sh/shotgun | import asyncio
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from pydantic_ai import Agent
from shotgun.agents.agent_manager import AgentManager
from shotgun.agents.config.models import ProviderType
from shotgun.agents.models import AgentDeps, AgentType
from shotgun.agen... | AgentType.ROUTER | assert | complex_expr | test/unit/agents/test_agent_manager_router.py | test_agent_manager_set_agent_to_router | 254 | null | |
shotgun-sh/shotgun | import os
import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from pydantic import SecretStr
from shotgun.agents.config.manager import ConfigManager
from shotgun.agents.config.models import (
AnthropicConfig,
GoogleConfig,
ModelConfig,
OpenAIConfig,
ProviderType,... | True | assert | bool_literal | test/unit/test_provider.py | test_get_provider_model_openai_compatible_mode | 367 | null | |
shotgun-sh/shotgun | from datetime import datetime, timezone
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from shotgun.cli.spec.models import PullSource
from shotgun.cli.spec.pull_service import (
CancelledError,
PullProgress,
SpecPullService,
)
from shotgun.shotgun_web.models i... | "tui" | assert | string_literal | test/unit/cli/spec/test_pull_service.py | test_pull_version_tracks_posthog_events | 342 | null | |
shotgun-sh/shotgun | from __future__ import annotations
import multiprocessing
import os
import sys
import tempfile
import threading
import time
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import TimeoutError as FuturesTimeoutError
from pathlib import Path
import psutil
import pytest
from shotgun.codebase.c... | 4 | assert | numeric_literal | test/integration/codebase/test_multiplatform.py | test_thread_creation_works | 283 | null | |
shotgun-sh/shotgun | import json
import tempfile
from pathlib import Path
import pytest
from shotgun.agents.config.manager import (
CURRENT_CONFIG_VERSION,
ConfigManager,
_apply_migrations,
_create_backup,
_migrate_v2_to_v3,
_migrate_v3_to_v4,
_migrate_v4_to_v5,
_migrate_v6_to_v7,
_migrate_v7_to_v8,
... | 5 | assert | numeric_literal | test/unit/test_config_migrations.py | test_migrate_v4_to_v5 | 228 | null | |
shotgun-sh/shotgun | import asyncio
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from pydantic_ai.messages import (
ModelRequest,
ModelResponse,
TextPart,
UserPromptPart,
)
from shotgun.agents.agent_manager import AgentManager
from shotgun.agents.config.models import Provide... | 2 | assert | numeric_literal | test/unit/test_agent_manager_filtering.py | test_filters_mixed_agent_prompts | 453 | null | |
shotgun-sh/shotgun | from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from pydantic_ai import RunContext
from shotgun.agents.models import (
AgentDeps,
AgentResponse,
AgentType,
FileOperationTracker,
)
from shotgun.agents.router.models import (
AddStepInput,
CreatePlanInput,
ExecutionPlan,
... | True | assert | bool_literal | test/unit/test_router_metrics.py | test_delegation_started_metric | 318 | null | |
shotgun-sh/shotgun | from __future__ import annotations
import pytest
from shotgun.codebase.core.extractors.javascript.extractor import JavaScriptExtractor
from shotgun.codebase.core.extractors.types import SupportedLanguage
from shotgun.codebase.core.parser_loader import load_parsers
def extractor():
"""Create a JavaScript extracto... | "obj" | assert | string_literal | test/unit/codebase/extractors/test_javascript_extractor.py | test_parse_method_call | 99 | null | |
shotgun-sh/shotgun | import pytest
from textual.app import App
from shotgun.tui.components.prompt_input import PromptInput
pytestmark = pytest.mark.asyncio
async def test_slash_in_empty_input_posts_open_command_palette() -> None:
"""Test that '/' in empty input triggers OpenCommandPalette message."""
messages_received: list = []... | "" | assert | string_literal | test/unit/tui/components/test_prompt_input.py | test_slash_in_empty_input_posts_open_command_palette | 37 | null | |
shotgun-sh/shotgun | import tempfile
from pathlib import Path
import pytest
from shotgun.codebase.core.metrics_types import (
FileInfo,
FileParseTask,
WorkBatch,
)
from shotgun.codebase.core.parallel_executor import ParallelExecutor
from shotgun.codebase.core.work_distributor import WorkDistributor
from shotgun.codebase.core.... | 4 | assert | numeric_literal | test/integration/codebase/test_parallel_correctness.py | test_parallel_extracts_all_definitions | 119 | null | |
shotgun-sh/shotgun | from unittest.mock import MagicMock, patch
import httpx
import pytest
from shotgun.shotgun_web.client import (
ShotgunWebClient,
check_token_status,
create_unification_token,
)
from shotgun.shotgun_web.constants import SHOTGUN_WEB_BASE_URL
from shotgun.shotgun_web.models import (
TokenStatus,
)
def m... | httpx.HTTPError) | pytest.raises | complex_expr | test/unit/shotgun_web/test_client.py | test_get_me_http_error | 346 | null | |
shotgun-sh/shotgun | import base64
from pathlib import Path
import pytest
from pydantic_ai.messages import DocumentUrl, ImageUrl
from shotgun.agents.config.models import ProviderType
from shotgun.attachments import (
parse_attachment_reference,
process_attachment,
)
from shotgun.attachments.models import AttachmentType
def sampl... | 0 | assert | numeric_literal | test/integration/test_attachment_flow.py | test_process_png_attachment_encodes_base64 | 88 | null | |
shotgun-sh/shotgun | import pytest
from pydantic_ai import RunContext
from shotgun.agents.models import AgentDeps
from shotgun.agents.tools.codebase import codebase_shell
from shotgun.codebase.models import CodebaseGraph
@pytest.mark.integration
@pytest.mark.asyncio
async def test_codebase_shell_ls_command(
indexed_graph: CodebaseGra... | 0 | assert | numeric_literal | test/integration/codebase/tools/test_codebase_shell.py | test_codebase_shell_ls_command | 26 | null | |
shotgun-sh/shotgun | import pytest
from shotgun.codebase import CodebaseService, QueryType
from shotgun.codebase.models import GraphStatus
@pytest.mark.integration
@pytest.mark.asyncio
async def test_list_graphs_empty(service: CodebaseService):
"""Test listing graphs when none exist."""
graphs = await service.list_graphs()
a... | [] | assert | collection | test/integration/codebase/test_codebase_service.py | test_list_graphs_empty | 26 | null | |
shotgun-sh/shotgun | from functools import partial
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from pydantic_ai.models.test import TestModel
from shotgun.agents.common import build_agent_system_prompt, create_base_agent
from shotgun.agents.config.models import (
ModelConfig,
ModelName,
ProviderType,
)
... | "5m" | assert | string_literal | test/unit/agents/test_anthropic_cache_settings.py | test_sub_agent_caches_messages_at_5m | 73 | null | |
shotgun-sh/shotgun | import time
from pathlib import Path
from shotgun.logging_config import cleanup_old_log_files
def test_cleanup_old_log_files_handles_permission_errors(tmp_path: Path) -> None:
"""Test that cleanup continues even if some files can't be deleted."""
# Create 5 log files
log_files = []
for i in range(5):
... | 3 | assert | numeric_literal | test/unit/test_logging_config.py | test_cleanup_old_log_files_handles_permission_errors | 144 | null | |
shotgun-sh/shotgun | import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import httpx
import pytest
from pydantic import SecretStr
from shotgun.agents.config.manager import ConfigManager
from shotgun.agents.config.models import (
KeyProvider,
ModelName,
OpenAIConfig,
ProviderType... | ModelName.GPT_5_1 | assert | complex_expr | test/unit/test_streaming_detection.py | test_get_provider_model_gpt5_byok_not_tested | 152 | null | |
shotgun-sh/shotgun | import asyncio
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from pydantic_ai.messages import (
ModelRequest,
ModelResponse,
TextPart,
UserPromptPart,
)
from shotgun.agents.agent_manager import AgentManager
from shotgun.agents.config.models import Provide... | 0 | assert | numeric_literal | test/unit/test_agent_manager_filtering.py | test_filters_mixed_agent_prompts | 454 | null | |
shotgun-sh/shotgun | from __future__ import annotations
from pathlib import Path
import pytest
from shotgun.codebase.benchmarks import BenchmarkRunner
from .conftest import CPUSampler, MemorySampler, cleanup_database_for_path
@pytest.mark.slow
@pytest.mark.performance
@pytest.mark.asyncio
async def test_benchmark_runner_produces_valid... | 1 | assert | numeric_literal | test/performance/codebase/test_parallel_performance.py | test_benchmark_runner_produces_valid_metrics | 252 | null | |
shotgun-sh/shotgun | import pytest
from pydantic_ai import RunContext
from shotgun.agents.models import AgentDeps
from shotgun.agents.tools.codebase import query_graph
from shotgun.codebase.models import CodebaseGraph
@pytest.mark.integration
@pytest.mark.asyncio
async def test_query_graph_invalid_graph_id(
run_context: RunContext[Ag... | None | assert | none_literal | test/integration/codebase/tools/test_query_graph.py | test_query_graph_invalid_graph_id | 25 | null | |
shotgun-sh/shotgun | from __future__ import annotations
from pathlib import Path
from unittest.mock import patch
import pytest
from shotgun.codebase import CodebaseService, QueryType
from shotgun.codebase.core.metrics_types import (
FileParseTask,
WorkBatch,
)
from shotgun.codebase.core.parallel_executor import ParallelExecutor
... | 0 | assert | numeric_literal | test/integration/codebase/test_error_handling.py | test_worker_handles_nonexistent_file | 44 | null | |
shotgun-sh/shotgun | import importlib
from unittest.mock import AsyncMock, patch
import pytest
from shotgun.agents.tools.codebase import CodeSnippetResult
from shotgun.codebase.core.code_retrieval import CodeSnippet
retrieve_code_module = importlib.import_module(
"shotgun.agents.tools.codebase.retrieve_code"
)
@pytest.mark.asyncio
... | result.error | assert | complex_expr | test/unit/codebase/tools/test_retrieve_code.py | test_retrieve_code_while_indexing | 87 | null | |
shotgun-sh/shotgun | from __future__ import annotations
import hashlib
import json
import shutil
from pathlib import Path
import pytest
from shotgun.codebase.benchmarks import (
BenchmarkRunner,
MetricsDisplayOptions,
MetricsExporter,
get_formatter,
)
from shotgun.utils.file_system_utils import get_shotgun_home
def samp... | 1 | assert | numeric_literal | test/integration/codebase/test_benchmark_cli.py | test_benchmark_runner_basic | 116 | null | |
shotgun-sh/shotgun | from shotgun.agents.autopilot.models import (
AutopilotMode,
AutopilotState,
ClaudeOutput,
ClaudeOutputType,
Stage,
StageStatus,
Task,
)
def test_autopilot_state_creation():
"""Test AutopilotState model creation."""
state = AutopilotState(
mode=AutopilotMode.PAUSE_BETWEEN,
... | [] | assert | collection | test/unit/agents/autopilot/test_models.py | test_autopilot_state_creation | 178 | null | |
shotgun-sh/shotgun | import hashlib
from pathlib import Path
import pytest
from shotgun.shotgun_web.shared_specs.hasher import (
LARGE_FILE_CHUNK_SIZE,
LARGE_FILE_THRESHOLD,
SMALL_FILE_CHUNK_SIZE,
_get_chunk_size,
calculate_sha256,
calculate_sha256_with_size,
)
@pytest.mark.asyncio
async def test_calculate_sha256... | hash2 | assert | variable | test/unit/shotgun_web/shared_specs/test_hasher.py | test_calculate_sha256_deterministic | 120 | null | |
shotgun-sh/shotgun | import json
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from shotgun.agents.config.models import ProviderType
from shotgun.agents.config.tier_detection import (
AnthropicTier,
get_configured_anthropic_tier,
)
from shotgun.agents.conversation import ConversationHistory
@pytest.mark.asy... | True | assert | bool_literal | test/unit/test_tier1_telemetry.py | test_conversation_service_saves_anthropic_tier | 133 | null | |
shotgun-sh/shotgun | import tempfile
from pathlib import Path
import pytest
from shotgun.codebase.core.metrics_types import (
FileInfo,
FileParseTask,
WorkBatch,
)
from shotgun.codebase.core.parallel_executor import ParallelExecutor
from shotgun.codebase.core.work_distributor import WorkDistributor
from shotgun.codebase.core.... | 1 | assert | numeric_literal | test/integration/codebase/test_parallel_correctness.py | test_parallel_extracts_inheritance | 173 | null | |
shotgun-sh/shotgun | import asyncio
from unittest.mock import AsyncMock, Mock
import pytest
from shotgun.agents.models import AgentType
from shotgun.agents.runner import AgentRunner
from shotgun.exceptions import (
AgentCancelledException,
BudgetExceededException,
ContextSizeLimitExceeded,
IncompleteToolCallError,
Unk... | exc | assert | variable | test/unit/agents/test_runner.py | test_runner_generic_exception | 117 | null | |
shotgun-sh/shotgun | from unittest.mock import MagicMock, patch
import pytest
from pydantic_ai import RunContext
from pydantic_ai.messages import (
BuiltinToolCallPart,
BuiltinToolReturnPart,
ModelRequest,
ModelResponse,
RetryPromptPart,
SystemPromptPart,
TextPart,
ThinkingPart,
ToolCallPart,
ToolRe... | 1 | assert | numeric_literal | test/unit/test_history_processors.py | test_incremental_compaction_maintains_small_context | TestMaxTokensCalculation | 1,212 | null |
shotgun-sh/shotgun | import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import httpx
import pytest
from pydantic import SecretStr
from shotgun.agents.config.manager import ConfigManager
from shotgun.agents.config.models import (
KeyProvider,
ModelName,
OpenAIConfig,
ProviderType... | True | assert | bool_literal | test/unit/test_streaming_detection.py | test_check_streaming_capability_success | 45 | null | |
shotgun-sh/shotgun | import asyncio
import pytest
from shotgun.agents.cancellation import (
CANCELLATION_CHECK_INTERVAL,
CANCELLATION_MESSAGE,
CancellableStreamIterator,
)
async def async_generator(items: list[int], delay: float = 0):
"""Helper async generator for testing."""
for item in items:
if delay > 0:
... | items | assert | variable | test/unit/agents/test_cancellation.py | test_cancellable_stream_iterator_yields_items_normally | 31 | null | |
shotgun-sh/shotgun | from __future__ import annotations
import hashlib
import json
import shutil
from pathlib import Path
import pytest
from shotgun.codebase.benchmarks import (
BenchmarkRunner,
MetricsDisplayOptions,
MetricsExporter,
get_formatter,
)
from shotgun.utils.file_system_utils import get_shotgun_home
def samp... | 2 | assert | numeric_literal | test/integration/codebase/test_benchmark_cli.py | test_benchmark_runner_multiple_iterations | 145 | null | |
shotgun-sh/shotgun | from unittest.mock import AsyncMock, Mock, patch
import pytest
from shotgun.codebase.core.code_retrieval import (
CodeSnippet,
retrieve_code_by_qualified_name,
)
def test_code_snippet_model_with_error():
"""Test CodeSnippet model creation with error state."""
snippet = CodeSnippet(
qualified_... | "" | assert | string_literal | test/unit/codebase/test_code_retrieval.py | test_code_snippet_model_with_error | 47 | null | |
shotgun-sh/shotgun | from shotgun.agents.config.models import ModelName
from shotgun.agents.context_analyzer.models import ContextAnalysis, MessageTypeStats
from shotgun.tui.components.context_indicator import ContextIndicator
def create_test_analysis(
agent_context_tokens: int = 72_000,
max_usable_tokens: int = 160_000,
) -> Cont... | "500" | assert | string_literal | test/unit/tui/components/test_context_indicator.py | test_context_indicator_format_token_count | 59 | null | |
shotgun-sh/shotgun | from __future__ import annotations
import hashlib
import json
import shutil
from pathlib import Path
import pytest
from shotgun.codebase.benchmarks import (
BenchmarkRunner,
MetricsDisplayOptions,
MetricsExporter,
get_formatter,
)
from shotgun.utils.file_system_utils import get_shotgun_home
def samp... | "test" | assert | string_literal | test/integration/codebase/test_benchmark_cli.py | test_json_formatter | 213 | null | |
shotgun-sh/shotgun | from pathlib import Path
import pytest
from shotgun.agents.autopilot.autopilot_orchestrator import (
AutopilotConfig,
AutopilotOrchestrator,
)
from shotgun.agents.autopilot.models import (
AutopilotMode,
Stage,
StageStatus,
Task,
)
def test_orchestrator_initialization():
"""Test Autopilot... | [] | assert | collection | test/unit/agents/autopilot/test_autopilot_orchestrator.py | test_orchestrator_initialization | 49 | null | |
shotgun-sh/shotgun | import pytest
from shotgun.agents.tools.codebase import DirectoryListResult, directory_lister
@pytest.mark.asyncio
async def test_directory_lister_success(
mock_run_context, mock_codebase_service, mock_graph, tmp_path
):
"""Test successful directory listing."""
# Create test directory structure
(tmp_p... | "." | assert | string_literal | test/unit/codebase/tools/test_directory_lister.py | test_directory_lister_success | 29 | null | |
shotgun-sh/shotgun | import json
import tempfile
from pathlib import Path
import pytest
from shotgun.agents.config.manager import (
CURRENT_CONFIG_VERSION,
ConfigManager,
_apply_migrations,
_create_backup,
_migrate_v2_to_v3,
_migrate_v3_to_v4,
_migrate_v4_to_v5,
_migrate_v6_to_v7,
_migrate_v7_to_v8,
... | 8 | assert | numeric_literal | test/unit/test_config_migrations.py | test_migrate_v7_to_v8 | 280 | null | |
shotgun-sh/shotgun | import asyncio
from pathlib import Path
from unittest.mock import patch
import pytest
from shotgun.codebase.models import QueryType
from shotgun.sdk import CodebaseSDK
from shotgun.sdk.exceptions import CodebaseNotFoundError, InvalidPathError
@pytest.mark.integration
@pytest.mark.asyncio
async def test_codebase_inde... | 2 | assert | numeric_literal | test/integration/sdk/test_sdk_codebase.py | test_codebase_index_started_event | 299 | null | |
shotgun-sh/shotgun | from shotgun.agents.tools.registry import (
ToolCategory,
ToolDisplayConfig,
get_tool_display_config,
register_tool,
register_tool_display,
)
def test_register_tool_display_function():
"""Test manually registering a display config for special tools."""
register_tool_display(
"specia... | "arg" | assert | string_literal | test/unit/agents/tools/test_tool_registry.py | test_register_tool_display_function | 42 | null | |
shotgun-sh/shotgun | import pytest
from pydantic_ai import RunContext
from shotgun.agents.models import AgentDeps
from shotgun.agents.tools.codebase import file_read
from shotgun.codebase.models import CodebaseGraph
@pytest.mark.integration
@pytest.mark.asyncio
async def test_file_read_main_file(
indexed_graph: CodebaseGraph,
run... | None | assert | none_literal | test/integration/codebase/tools/test_file_read.py | test_file_read_main_file | 25 | null | |
django-commons/django-unicorn | from unittest.mock import MagicMock, patch
import pytest
from django_unicorn.cacher import (
CacheableComponent,
PointerUnicornView,
cache_full_tree,
restore_from_cache,
)
from django_unicorn.components import UnicornView
from django_unicorn.errors import UnicornCacheError
def test_cacheable_componen... | parent.children | assert | complex_expr | tests/test_cacher.py | test_cacheable_component_restores_state_on_pickle_failure | 249 | null | |
django-commons/django-unicorn | import pytest
from django_unicorn.typer import _construct_model
from example.books.models import Author, Book
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_construct_model_foreign_key():
flavor = Flavor(name="first-flavor")
flavor.save()
parent = Flavor(name="parent-flavor")
... | parent.name | assert | complex_expr | tests/views/utils/test_construct_model.py | test_construct_model_foreign_key | 38 | null | |
django-commons/django-unicorn | import pytest
from django_unicorn.components import UnicornView
from django_unicorn.serializer import dumps, loads
from django_unicorn.typer import _construct_model
from django_unicorn.views.utils import set_property_from_data
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_model():
flavo... | flavor.name | assert | complex_expr | tests/test_model_lifecycle.py | test_model | 30 | null | |
django-commons/django-unicorn | from datetime import datetime
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor, Taste
@pytest.mark.django_db
def test_set_property_value_many_to_many_is_referenced():
component = FakeC... | 1 | assert | numeric_literal | tests/views/action_parsers/utils/test_set_property_value.py | test_set_property_value_many_to_many_is_referenced | 127 | null | |
django-commons/django-unicorn | import pytest
from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView
from example.coffee.models import Flavor, Taste
@pytest.mark.django_db
def test_m2m_overwriting(client):
# Setup
flavor1 = Flavor.objects.create(name="Flavor 1")
flavor2 = Flavor.obj... | 2 | assert | numeric_literal | tests/views/test_m2m_overwriting.py | test_m2m_overwriting | 39 | null | |
django-commons/django-unicorn | from unittest.mock import MagicMock, patch
import pytest
from django_unicorn.cacher import (
CacheableComponent,
PointerUnicornView,
cache_full_tree,
restore_from_cache,
)
from django_unicorn.components import UnicornView
from django_unicorn.errors import UnicornCacheError
def test_cacheable_componen... | parent | assert | variable | tests/test_cacher.py | test_cacheable_component_restores_state_on_pickle_failure | 247 | null | |
django-commons/django-unicorn | import datetime
from dataclasses import dataclass
from typing import get_type_hints as typing_get_type_hints
from pydantic import BaseModel
from django_unicorn.components import UnicornView
from django_unicorn.typer import cast_attribute_value, cast_value, get_type_hints
from example.coffee.models import Flavor
def ... | [test_data] | assert | collection | tests/test_typer.py | test_cast_value_list_dataclass | 162 | null | |
django-commons/django-unicorn | from datetime import datetime
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor, Taste
def test_set_property_value_model():
component = FakeComponent(component_name="test", component_id... | model.name | assert | complex_expr | tests/views/action_parsers/utils/test_set_property_value.py | test_set_property_value_model | 78 | null | |
django-commons/django-unicorn | import sys
from datetime import datetime, timezone
from typing import List # noqa: UP035
import pytest
from django.db.models import Model, QuerySet
from django_unicorn.components import UnicornView
from django_unicorn.typing import QuerySetType
from django_unicorn.views.utils import set_property_from_data
from examp... | component.string | assert | complex_expr | tests/views/utils/test_set_property_from_data.py | test_set_property_from_data_str | 64 | null | |
django-commons/django-unicorn | import json
from unittest.mock import Mock
import pytest
from django_unicorn.components import Component
from django_unicorn.errors import RenderNotModifiedError
from django_unicorn.utils import generate_checksum
from django_unicorn.views.action import CallMethod, Refresh, SyncInput, Toggle
from django_unicorn.views.... | "$toggle" | assert | string_literal | tests/views/test_unit_views.py | test_action_toggle | 32 | null | |
django-commons/django-unicorn | from datetime import datetime
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor, Taste
def test_set_property_value_str():
component = FakeComponent(component_name="test", component_id="... | component.string | assert | complex_expr | tests/views/action_parsers/utils/test_set_property_value.py | test_set_property_value_str | 22 | null | |
django-commons/django-unicorn | from tests.views.fake_components import FakeComponent
from django_unicorn.views.action_parsers.call_method import _get_property_value
def test_get_property_value():
component = FakeComponent(component_name="test", component_id="asdf")
component.check = False
check_value = _get_property_value(component, "... | True | assert | bool_literal | tests/views/message/test_get_property_value.py | test_get_property_value | 16 | null | |
django-commons/django-unicorn | import json
from unittest.mock import Mock
import pytest
from django_unicorn.components import Component
from django_unicorn.errors import RenderNotModifiedError
from django_unicorn.utils import generate_checksum
from django_unicorn.views.action import CallMethod, Refresh, SyncInput, Toggle
from django_unicorn.views.... | "123" | assert | string_literal | tests/views/test_unit_views.py | test_component_request_parsing | 53 | null | |
django-commons/django-unicorn | from django_unicorn.typer import get_type_hints
def test_get_type_hints_inheritance():
"""
Verify that get_type_hints returns type hints from parent classes
when called with an instance of a subclass.
"""
instance = Child()
type_hints = get_type_hints(instance)
assert "name" in | type_hints | assert | variable | tests/components/test_typer_inheritance.py | test_get_type_hints_inheritance | 20 | null | |
django-commons/django-unicorn | from datetime import date, datetime, time, timedelta
from types import MappingProxyType
from uuid import UUID, uuid4
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.call_method import _call_method_name
from example.coffee.models import Flavor
@pytest.mark.djan... | flavor_one.pk | assert | complex_expr | tests/views/action_parsers/call_method/test_call_method_name.py | test_call_method_name_arg_with_model_type_annotation_multiple | 132 | null | |
django-commons/django-unicorn | import json
import uuid
from datetime import timedelta
from decimal import Decimal
from types import MappingProxyType
from typing import cast
import pytest
from django.db import models
from django.db.models import Model
from django.utils.timezone import now
from pydantic import BaseModel
from django_unicorn import se... | 5 | assert | numeric_literal | tests/serializer/test_dumps.py | test_tuple_of_dicts_mixed_types | 871 | null | |
django-commons/django-unicorn | import sys
from datetime import datetime, timezone
from typing import List # noqa: UP035
import pytest
from django.db.models import Model, QuerySet
from django_unicorn.components import UnicornView
from django_unicorn.typing import QuerySetType
from django_unicorn.views.utils import set_property_from_data
from examp... | Flavor | assert | variable | tests/views/utils/test_set_property_from_data.py | component_queryset_field_asserts | 57 | null | |
django-commons/django-unicorn | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import redirect
from django.test import RequestFactory
from django_unicorn.components.unicorn_view import UnicornView, construct_component
def test_mount_redirect_direct_view():
request = RequestFactory().get("/")
view = Redirect... | "/somewhere-else" | assert | string_literal | tests/components/test_mount_redirect.py | test_mount_redirect_direct_view | 24 | null | |
django-commons/django-unicorn | import time
from typing import Any
import orjson
import shortuuid
from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView, unicorn_view
from django_unicorn.utils import generate_checksum
def _post_to_component(
client,
method_name: str,
component_name... | dom | assert | variable | tests/views/message/test_call_method.py | test_message_call_method_with_message | 67 | null | |
django-commons/django-unicorn | from datetime import datetime, timezone
from django import forms
from django.contrib import messages
from django.contrib.auth.forms import AuthenticationForm
from django.forms import ValidationError
from django.shortcuts import redirect
from django_unicorn.components import (
HashUpdate,
LocationUpdate,
P... | 1 | assert | numeric_literal | tests/views/fake_components.py | updating_count | FakeComponentWithUpdateMethods | 176 | null |
django-commons/django-unicorn | import time
import orjson
import shortuuid
from django_unicorn.utils import generate_checksum
def _post_message_and_get_body(client, message, url="/message/tests.views.fake_components.FakeComponent"):
response = client.post(
url,
message,
content_type="application/json",
)
body =... | "does=thiswork?" | assert | string_literal | tests/views/message/test_set_property.py | test_equal_sign | 125 | null | |
django-commons/django-unicorn | import shortuuid
from django.test import Client, RequestFactory
from django_unicorn.components import UnicornView
from django_unicorn.signals import (
component_completed,
component_hydrated,
component_method_called,
component_method_calling,
component_mounted,
component_post_parsed,
compon... | None | assert | none_literal | tests/test_signals.py | test_component_method_called_signal_success | 150 | null | |
django-commons/django-unicorn | from django_unicorn.components.unicorn_view import convert_to_pascal_case
def test_convert_to_pascal_case():
expected = "HelloWorld"
actual = convert_to_pascal_case("hello-world")
assert expected == | actual | assert | variable | tests/components/test_convert_to_pascal_case.py | test_convert_to_pascal_case | 8 | null | |
django-commons/django-unicorn | import time
from typing import Any
import orjson
import shortuuid
from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView, unicorn_view
from django_unicorn.utils import generate_checksum
def _post_to_component(
client,
method_name: str,
component_name... | body | assert | variable | tests/views/message/test_call_method.py | test_message_call_method_redirect | 53 | null | |
django-commons/django-unicorn | from django.template.base import Parser, Token, TokenType
from django_unicorn.templatetags.unicorn import unicorn
def test_unicorn():
token = Token(TokenType.TEXT, "unicorn 'todo'")
unicorn_node = unicorn(Parser([]), token)
assert unicorn_node.component_name.resolve({}) == "todo"
assert len(unicorn_... | 0 | assert | numeric_literal | tests/templatetags/test_unicorn.py | test_unicorn | 11 | null | |
django-commons/django-unicorn | import shortuuid
from django.test import Client, RequestFactory
from django_unicorn.components import UnicornView
from django_unicorn.signals import (
component_completed,
component_hydrated,
component_method_called,
component_method_calling,
component_mounted,
component_post_parsed,
compon... | last | assert | variable | tests/test_signals.py | test_component_method_called_signal_success | 151 | null | |
django-commons/django-unicorn | import types
import orjson
import pytest
from tests.views.fake_components import (
FakeAuthenticationComponent,
FakeValidationComponent,
)
from django_unicorn.components import UnicornView
from django_unicorn.serializer import InvalidFieldNameError
def component():
return ExampleComponent(component_id="a... | "name" | assert | string_literal | tests/components/test_component.py | test_init_attribute_names_cache | 46 | null | |
django-commons/django-unicorn | import orjson
import pytest
from django.template import Context
from django.template.base import Parser, Token, TokenType
from django_unicorn.components import UnicornView
from django_unicorn.components.unicorn_template_response import get_root_element
from django_unicorn.errors import ComponentNotValidError
from djan... | "/test" | assert | string_literal | tests/templatetags/test_unicorn_render.py | test_unicorn_template_renders | 101 | null | |
django-commons/django-unicorn | from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView
def test_html_entities_encoded(client):
data = {"hello": "test"}
action_queue = [
{
"payload": {"name": "hello", "value": "<b>test1</b>"},
"type": "syncInput",
... | "<b>test1</b>" | assert | string_literal | tests/views/test_process_component_request.py | test_html_entities_encoded | 37 | null | |
django-commons/django-unicorn | import time
from uuid import uuid4
import pytest
from django.http import JsonResponse
from django_unicorn.errors import ComponentClassLoadError, ComponentModuleLoadError
from django_unicorn.views import message
def assert_json_error(response, error):
assert isinstance(response, JsonResponse)
assert response.... | "Missing epoch") | assert_* | string_literal | tests/views/message/test_message.py | test_message_no_epoch | 84 | null | |
django-commons/django-unicorn | import json
from unittest.mock import Mock
import pytest
from django_unicorn.components import Component
from django_unicorn.errors import RenderNotModifiedError
from django_unicorn.utils import generate_checksum
from django_unicorn.views.action import CallMethod, Refresh, SyncInput, Toggle
from django_unicorn.views.... | data | assert | variable | tests/views/test_unit_views.py | test_component_response_structure | 118 | null | |
django-commons/django-unicorn | import types
import orjson
import pytest
from tests.views.fake_components import (
FakeAuthenticationComponent,
FakeValidationComponent,
)
from django_unicorn.components import UnicornView
from django_unicorn.serializer import InvalidFieldNameError
def component():
return ExampleComponent(component_id="a... | 0 | assert | numeric_literal | tests/components/test_component.py | test_get_frontend_context_variables_javascript_exclude | 91 | null | |
django-commons/django-unicorn | import pytest
from django_unicorn.typer import _construct_model
from example.books.models import Author, Book
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_construct_model_many_to_many():
author = Author(name="author 1")
author.save()
book = Book(title="book 1", date_published="... | book.title | assert | complex_expr | tests/views/utils/test_construct_model.py | test_construct_model_many_to_many | 84 | null | |
django-commons/django-unicorn | import types
import orjson
import pytest
from tests.views.fake_components import (
FakeAuthenticationComponent,
FakeValidationComponent,
)
from django_unicorn.components import UnicornView
from django_unicorn.serializer import InvalidFieldNameError
def component():
return ExampleComponent(component_id="a... | False | assert | bool_literal | tests/components/test_component.py | test_remove_is_not_public_attribute | 236 | null | |
django-commons/django-unicorn | from datetime import datetime
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor, Taste
def test_set_property_value_int():
component = FakeComponent(component_name="test", component_id="... | integer | assert | variable | tests/views/action_parsers/utils/test_set_property_value.py | test_set_property_value_int | 47 | null | |
django-commons/django-unicorn | import time
from typing import Any
import orjson
import shortuuid
from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView, unicorn_view
from django_unicorn.utils import generate_checksum
def _post_to_component(
client,
method_name: str,
component_name... | 3 | assert | numeric_literal | tests/views/message/test_call_method.py | test_message_call_method_args | 185 | null | |
django-commons/django-unicorn | import pytest
from django_unicorn.components import UnicornView
from django_unicorn.serializer import dumps, loads
from django_unicorn.typer import _construct_model
from django_unicorn.views.utils import set_property_from_data
from example.coffee.models import Flavor
@pytest.mark.django_db
def test_model():
flavo... | flavor.pk | assert | complex_expr | tests/test_model_lifecycle.py | test_model | 29 | null | |
django-commons/django-unicorn | import sys
from datetime import datetime, timezone
from typing import List # noqa: UP035
import pytest
from django.db.models import Model, QuerySet
from django_unicorn.components import UnicornView
from django_unicorn.typing import QuerySetType
from django_unicorn.views.utils import set_property_from_data
from examp... | component.array | assert | complex_expr | tests/views/utils/test_set_property_from_data.py | test_set_property_from_data_list | 115 | null | |
django-commons/django-unicorn | from datetime import date, datetime, time, timedelta
from types import MappingProxyType
from uuid import UUID, uuid4
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.call_method import _call_method_name
from example.coffee.models import Flavor
def test_call_met... | expected | assert | variable | tests/views/action_parsers/call_method/test_call_method_name.py | test_call_method_name_no_params | 84 | null | |
django-commons/django-unicorn | import pytest
from django_unicorn.components.unicorn_view import get_locations
def cache_clear():
get_locations.cache_clear()
def clear_apps(settings):
unicorn_apps = settings.UNICORN["APPS"]
unicorn_apps = settings.UNICORN.get("APPS")
if "APPS" in settings.UNICORN:
settings.UNICORN = {**sett... | AssertionError | assert | variable | tests/components/test_get_locations.py | test_get_locations_apps_setting_invalid | 140 | null | |
django-commons/django-unicorn | import time
from typing import Any
import orjson
import shortuuid
from tests.views.message.utils import post_and_get_response
from django_unicorn.components import UnicornView, unicorn_view
from django_unicorn.utils import generate_checksum
def _post_to_component(
client,
method_name: str,
component_name... | 1 | assert | numeric_literal | tests/views/message/test_call_method.py | test_message_call_method | 40 | null | |
django-commons/django-unicorn | from datetime import datetime
import pytest
from django_unicorn.components import UnicornView
from django_unicorn.views.action_parsers.utils import set_property_value
from example.coffee.models import Flavor, Taste
@pytest.mark.django_db
def test_set_property_value_many_to_many_references_model():
component = Fa... | [flavor.pk] | assert | collection | tests/views/action_parsers/utils/test_set_property_value.py | test_set_property_value_many_to_many_references_model | 153 | null | |
django-commons/django-unicorn | from django_unicorn.components import UnicornView
from django_unicorn.views.utils import _is_component_field_model_or_unicorn_field
from example.coffee.models import Flavor
def test_type_hint():
component = TypeHintView(component_name="asdf", component_id="test_type_hint")
name = "model"
actual = _is_compo... | None | assert | none_literal | tests/views/test_is_component_field_model_or_unicorn_field.py | test_type_hint | 20 | null | |
django-commons/django-unicorn | from django_unicorn.templatetags.unicorn import unicorn_scripts
def test_unicorn_scripts():
actual = unicorn_scripts()
assert actual["CSRF_HEADER_NAME"] == "X-CSRFTOKEN"
assert actual["CSRF_COOKIE_NAME"] == | "csrftoken" | assert | string_literal | tests/templatetags/test_unicorn_scripts.py | test_unicorn_scripts | 8 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.