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 |
|---|---|---|---|---|---|---|---|---|---|
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import json
import pathlib
import pytest
from tmuxp import cli
from tmuxp.cli.ls import (
_get_workspace_info,
create_ls_subparser,
)
def test_get_workspace_info_yaml(tmp_path: pathlib.Path) -> None:
"""Extract metadata from YAML workspace file."""
... | 0 | assert | numeric_literal | tests/cli/test_ls.py | test_get_workspace_info_yaml | 28 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import contextlib
import pathlib
import typing as t
import libtmux
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.cli.import_config import get_teamocil_dir, get_tmu... | "/moo/.teamocil" | assert | string_literal | tests/cli/test_cli.py | test_get_teamocil_dir | 111 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from tests._internal.conftest import ANSI_BOLD, ANSI_MAGENTA, ANSI_RESET
from tmuxp._internal.colors import ColorMode, Colors, get_color_mode
def test_color_flag_auto_with_tty(monkeypatch: pytest.MonkeyPatch) -> None:
"""Verify --col... | True | assert | bool_literal | tests/_internal/test_colors_integration.py | test_color_flag_auto_with_tty | 24 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pathlib
import typing as t
import pytest
from tmuxp import cli
from tmuxp.cli.utils import tmuxp_echo
from tmuxp.workspace.finders import (
find_workspace_file,
get_workspace_dir,
get_workspace_dir_candidates,
in_cwd,
in_dir,
is_pure_n... | candidate | assert | variable | tests/workspace/test_finder.py | test_get_workspace_dir_candidates | 467 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import io
import typing as t
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
@pytest.mark.parametrize(
list(ImportTestFixture._fields),
IMPORT_TEST_FIXTURES,
ids=[test.test_id for test in IMPORT_TEST_FIXTURES],
)
def... | result.out | assert | complex_expr | tests/cli/test_import.py | test_import | 48 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import typing as t
import pytest
from sphinx_argparse_neo.parser import (
ArgumentInfo,
ParserInfo,
SubcommandInfo,
_extract_argument,
_format_default,
_get_action_name,
_get_type_name,
extract_parser,
)
def test_extract_parser_with_d... | "42" | assert | string_literal | tests/docs/_ext/sphinx_argparse_neo/test_parser.py | test_extract_parser_with_defaults | 371 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pathlib
import typing as t
import pytest
from tmuxp import cli
from tmuxp.cli.utils import tmuxp_echo
from tmuxp.workspace.finders import (
find_workspace_file,
get_workspace_dir,
get_workspace_dir_candidates,
in_cwd,
in_dir,
is_pure_n... | str(tmp_path) | assert | func_call | tests/workspace/test_finder.py | test_tmuxp_configdir_env_var | 155 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from tests._internal.conftest import ANSI_BOLD, ANSI_MAGENTA, ANSI_RESET
from tmuxp._internal.colors import ColorMode, Colors, get_color_mode
def test_get_color_mode_none_defaults_to_auto() -> None:
"""Verify None input returns AUTO ... | ColorMode.AUTO | assert | complex_expr | tests/_internal/test_colors_integration.py | test_get_color_mode_none_defaults_to_auto | 169 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import pytest
from tests._internal.conftest import (
ANSI_BLUE,
ANSI_BOLD,
ANSI_BRIGHT_CYAN,
ANSI_CYAN,
ANSI_GREEN,
ANSI_MAGENTA,
ANSI_RED,
ANSI_RESET,
ANSI_YELLOW,
)
from tmuxp._internal.colors import (
ColorMode,
Colors,
... | "warn" | assert | string_literal | tests/_internal/test_colors.py | test_never_mode_disables | 88 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from tmuxp import exc
from tmuxp.exc import BeforeLoadScriptError, BeforeLoadScriptNotExists
from tmuxp.util import get_session, run_before_script
from .constants import FIXTURE_PATH
def temp_script(tmp_path: pathlib.Path) -> pathlib.Pa... | None | assert | none_literal | tests/test_util.py | test_get_session_should_default_to_local_attached_session | 150 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import typing as t
import pytest
from sphinx_argparse_neo.parser import (
ArgumentInfo,
ParserInfo,
SubcommandInfo,
_extract_argument,
_format_default,
_get_action_name,
_get_type_name,
extract_parser,
)
def test_extract_parser_simple... | 1 | assert | numeric_literal | tests/docs/_ext/sphinx_argparse_neo/test_parser.py | test_extract_parser_simple | 261 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import typing as t
import pytest
from sphinx_argparse_neo.parser import (
ArgumentInfo,
ParserInfo,
SubcommandInfo,
_extract_argument,
_format_default,
_get_action_name,
_get_type_name,
extract_parser,
)
def test_get_type_name_int() -... | "int" | assert | string_literal | tests/docs/_ext/sphinx_argparse_neo/test_parser.py | test_get_type_name_int | 97 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import json
import pathlib
import pytest
from tmuxp import cli
from tmuxp.cli.ls import (
_get_workspace_info,
create_ls_subparser,
)
def test_ls_json_output(
isolated_home: pathlib.Path,
capsys: pytest.CaptureFixture[str],
) -> None:
"""CLI t... | 2 | assert | numeric_literal | tests/cli/test_ls.py | test_ls_json_output | 172 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import io
import pathlib
import typing as t
import libtmux
import pytest
from libtmux.server import Server
from libtmux.session import Session
from tests.constants import FIXTURE_PATH
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp.... | 0 | assert | numeric_literal | tests/cli/test_load.py | test_load_attached_detached | 686 | null | |
tmux-python/tmuxp | from __future__ import annotations
import json
import typing as t
import pytest
from tmuxp import cli
def test_debug_info_json_output(
monkeypatch: pytest.MonkeyPatch,
capsys: pytest.CaptureFixture[str],
) -> None:
"""JSON output is valid JSON with expected structure."""
monkeypatch.setenv("SHELL", ... | data | assert | variable | tests/cli/test_debug_info.py | test_debug_info_json_output | 107 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import contextlib
import pathlib
import typing as t
import libtmux
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.cli.import_config import get_teamocil_dir, get_tmu... | check_cmd("myconfig").out | assert | func_call | tests/cli/test_cli.py | test_pass_config_dir_argparse | 142 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import typing as t
from docutils import nodes
from sphinx_argparse_neo.nodes import (
argparse_argument,
argparse_group,
argparse_program,
argparse_subcommand,
argparse_subcommands,
argparse_usage,
)
from sphinx_argparse_neo.parser import (
... | "" | assert | string_literal | tests/docs/_ext/sphinx_argparse_neo/test_renderer.py | test_render_config_defaults | 38 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pathlib
import typing as t
import pytest
from tmuxp import cli
from tmuxp.cli.utils import tmuxp_echo
from tmuxp.workspace.finders import (
find_workspace_file,
get_workspace_dir,
get_workspace_dir_candidates,
in_cwd,
in_dir,
is_pure_n... | str(tmux_dir) | assert | func_call | tests/workspace/test_finder.py | test_tmuxp_configdir_xdg_config_dir | 167 | null | |
tmux-python/tmuxp | from __future__ import annotations
import sys
import typing as t
import pytest
from sphinx_argparse_neo.compat import (
MockModule,
get_parser_from_entry_point,
get_parser_from_module,
import_module,
mock_imports,
)
def test_get_parser_from_entry_point_valid() -> None:
"""Test parsing valid e... | "entry" | assert | string_literal | tests/docs/_ext/sphinx_argparse_neo/test_compat.py | test_get_parser_from_entry_point_valid | 273 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from argparse_lexer import (
ArgparseHelpLexer,
ArgparseLexer,
ArgparseUsageLexer,
tokenize_argparse,
tokenize_usage,
)
def get_tokens(text: str, lexer_class: type = ArgparseLexer) -> list[tuple[str, str]]:
"""Get tokens as (... | tokens | assert | variable | tests/docs/_ext/test_argparse_lexer.py | test_mutex_groups | 313 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import pytest
from tmuxp._internal.private_path import PrivatePath, collapse_home_in_string
def test_private_path_collapses_home(monkeypatch: pytest.MonkeyPatch) -> None:
"""PrivatePath replaces home directory with ~."""
monkeypatch.setattr(pathlib.Path, "ho... | "~/projects/tmuxp" | assert | string_literal | tests/_internal/test_private_path.py | test_private_path_collapses_home | 19 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import io
import subprocess
import typing as t
import pytest
from tmuxp import cli, exc
@pytest.mark.parametrize(
list(CLIShellInteractiveFixture._fields),
TEST_SHELL_INTERACTIVE_FIXTURES,
ids=[test.test_id for test in TEST_SHELL_INTERACTIVE_FIXTURES]... | result.err | assert | complex_expr | tests/cli/test_shell.py | test_shell_interactive | 473 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import contextlib
import pathlib
import typing as t
import libtmux
import pytest
from tests.fixtures import utils as test_utils
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.cli.import_config import get_teamocil_dir, get_tmu... | expect | assert | variable | tests/cli/test_cli.py | test_resolve_behavior | 86 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from cli_usage_lexer import (
CLIUsageLexer,
tokenize_usage,
)
def get_tokens(text: str) -> list[tuple[str, str]]:
"""Get tokens as (type_name, value) tuples."""
lexer = CLIUsageLexer()
return [
(str(tok_type), tok_value)... | 3 | assert | numeric_literal | tests/docs/_ext/test_cli_usage_lexer.py | test_long_option_with_value | 227 | null | |
tmux-python/tmuxp | from __future__ import annotations
import contextlib
import io
import typing as t
import pytest
from tmuxp import cli
from tmuxp._internal.config_reader import ConfigReader
@pytest.mark.parametrize(
list(FreezeTestFixture._fields),
FREEZE_TEST_FIXTURES,
ids=[test.test_id for test in FREEZE_TEST_FIXTURES... | "myfrozensession" | assert | string_literal | tests/cli/test_freeze.py | test_freeze | 116 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
from tests.cli.conftest import (
ANSI_BLUE,
ANSI_CYAN,
ANSI_GREEN,
ANSI_RED,
ANSI_RESET,
)
from tmuxp._internal.private_path import PrivatePath
from tmuxp.cli._colors import Colors
def test_import_error_unknown_format(colors_always: Colors) -> Non... | result | assert | variable | tests/cli/test_import_colors.py | test_import_error_unknown_format | 24 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pathlib
import typing as t
import pytest
from tmuxp import cli
from tmuxp.cli.utils import tmuxp_echo
from tmuxp.workspace.finders import (
find_workspace_file,
get_workspace_dir,
get_workspace_dir_candidates,
in_cwd,
in_dir,
is_pure_n... | check_cmd("").out | assert | func_call | tests/workspace/test_finder.py | test_find_workspace_file_arg | 342 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import pytest
from tests.cli.conftest import ANSI_BLUE, ANSI_CYAN, ANSI_RESET
from tmuxp.cli._colors import ColorMode, Colors
def test_prompt_default_uses_private_path(
monkeypatch: pytest.MonkeyPatch,
tmp_path: pathlib.Path,
) -> None:
"""Verify prompt(... | test_path | assert | variable | tests/cli/test_prompt_colors.py | test_prompt_default_uses_private_path | 151 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import typing as t
from docutils import nodes
from sphinx_argparse_neo.nodes import (
argparse_argument,
argparse_group,
argparse_program,
argparse_subcommand,
argparse_subcommands,
argparse_usage,
)
from sphinx_argparse_neo.parser import (
... | True | assert | bool_literal | tests/docs/_ext/sphinx_argparse_neo/test_renderer.py | test_render_config_defaults | 39 | null | |
tmux-python/tmuxp | from __future__ import annotations
import argparse
import pytest
from tests.cli.conftest import ANSI_RESET
from tmuxp.cli._colors import ColorMode, Colors
from tmuxp.cli._formatter import (
HelpTheme,
TmuxpHelpFormatter,
create_themed_formatter,
)
def test_create_themed_formatter_with_colors_enabled(
... | "" | assert | string_literal | tests/cli/test_formatter.py | test_create_themed_formatter_with_colors_enabled | 34 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import pytest
from tests.cli.conftest import ANSI_BLUE, ANSI_CYAN, ANSI_RESET
from tmuxp.cli._colors import ColorMode, Colors
def test_prompts_respect_no_color_env(monkeypatch: pytest.MonkeyPatch) -> None:
"""Verify NO_COLOR disables prompt colors."""
monkey... | "[Y/n]" | assert | string_literal | tests/cli/test_prompt_colors.py | test_prompts_respect_no_color_env | 52 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import typing as t
import pytest
from tests.constants import EXAMPLE_PATH
from tmuxp import exc
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.workspace import loader, validation
def load_workspace(path: str | pathlib.Path) -> dict[str, t.Any]:
... | expanded_dict | assert | variable | tests/workspace/test_config.py | test_workspace_expand2 | 59 | null | |
tmux-python/tmuxp | from __future__ import annotations
import typing as t
import pytest
from argparse_exemplar import ( # type: ignore[import-not-found]
ExemplarConfig,
_extract_sections_from_container,
_is_examples_section,
_is_usage_block,
_reorder_nodes,
is_base_examples_term,
is_examples_term,
make_s... | 4 | assert | numeric_literal | tests/docs/_ext/test_argparse_exemplar.py | test_reorder_nodes_usage_after_examples | 721 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import typing as t
import pytest
from tests.constants import EXAMPLE_PATH
from tmuxp import exc
from tmuxp._internal.config_reader import ConfigReader
from tmuxp.workspace import loader, validation
def load_workspace(path: str | pathlib.Path) -> dict[str, t.Any]:
... | config_fixture.trickle.expected | assert | complex_expr | tests/workspace/test_config.py | test_trickle_relative_start_directory | 162 | null | |
tmux-python/tmuxp | from __future__ import annotations
import pathlib
import pytest
from tests.cli.conftest import ANSI_BLUE, ANSI_CYAN, ANSI_RESET
from tmuxp.cli._colors import ColorMode, Colors
def test_prompt_default_uses_private_path(
monkeypatch: pytest.MonkeyPatch,
tmp_path: pathlib.Path,
) -> None:
"""Verify prompt(... | None | assert | none_literal | tests/cli/test_prompt_colors.py | test_prompt_default_uses_private_path | 154 | null | |
tmux-python/tmuxp | from __future__ import annotations
import json
import typing as t
import pytest
from tmuxp import cli
def test_debug_info_json_output(
monkeypatch: pytest.MonkeyPatch,
capsys: pytest.CaptureFixture[str],
) -> None:
"""JSON output is valid JSON with expected structure."""
monkeypatch.setenv("SHELL", ... | env | assert | variable | tests/cli/test_debug_info.py | test_debug_info_json_output | 120 | null | |
Upsonic/Upsonic | import os
import shutil
import tempfile
from pathlib import Path
from typing import Optional
import pytest
from upsonic import AutonomousAgent
from upsonic.agent import Agent
from upsonic.agent.autonomous_agent import (
AutonomousFilesystemToolKit,
AutonomousShellToolKit,
)
from upsonic.storage import InMemor... | True | assert | bool_literal | tests/smoke_tests/autonomous_agent/test_autonomous_agent.py | test_heartbeat_custom_values | TestAutonomousAgentInitialization | 227 | null |
Upsonic/Upsonic | import pytest
from upsonic import Agent, Task
pytestmark = pytest.mark.timeout(60)
@pytest.mark.asyncio
async def test_use_llm_for_selection():
"""Test that use_llm_for_selection uses LLM for model recommendations."""
# Create agent with LLM-based selection
agent = Agent(
model="openai/gpt-4o",
... | True | assert | bool_literal | tests/smoke_tests/test_model_selection.py | test_use_llm_for_selection | 66 | null | |
Upsonic/Upsonic | import asyncio
import os
import sys
import time
import uuid
from typing import Any, Dict, List, Optional
from upsonic.session.agent import AgentSession, RunData
from upsonic.session.base import SessionType
from upsonic.storage.schemas import UserMemory
from upsonic.storage.mongo import AsyncMongoStorage
from upsonic.r... | 0 | assert | numeric_literal | tests/smoke_tests/memory/test_async_mongo_storage_comprehensive.py | test_session_bulk_upsert | 436 | null | |
Upsonic/Upsonic | import unittest
from unittest.mock import patch, AsyncMock, MagicMock, mock_open
import pytest
from pydantic import BaseModel
from upsonic import Direct, Task
from upsonic.models import ModelResponse, TextPart, ModelRequestParameters
from upsonic.models.settings import ModelSettings
from upsonic.profiles import ModelP... | "") | self.assertNotEqual | string_literal | tests/unit_tests/agent/test_direct.py | test_direct_do_with_text_task | TestDirectDoMethods | 260 | null |
Upsonic/Upsonic | import pytest
from unittest.mock import Mock, AsyncMock, patch
from upsonic.agent.context_managers.call_manager import CallManager
from upsonic.agent.context_managers.task_manager import TaskManager
from upsonic.agent.context_managers.reliability_manager import ReliabilityManager
from upsonic.agent.context_managers.ll... | "" | assert | string_literal | tests/unit_tests/agent/test_context_managers.py | test_system_prompt_manager_initialization | TestSystemPromptManager | 467 | null |
Upsonic/Upsonic | import json
from typing import Any, List, Optional
import pytest
from upsonic.agent.context_managers.context_management_middleware import (
CONTEXT_FULL_MESSAGE,
ContextManagementMiddleware,
)
from upsonic.messages import (
ModelRequest,
ModelResponse,
SystemPromptPart,
TextPart,
ToolCallP... | 1 | assert | numeric_literal | tests/smoke_tests/agent/test_context_management_stages.py | test_build_context_full_response_structure | TestContextFullSignal | 555 | null |
Upsonic/Upsonic | import pytest
import asyncio
import os
import time
from typing import Any, Dict, List
from upsonic import Agent, Task
from upsonic.tools import tool
from upsonic.run.base import RunStatus
from upsonic.run.cancel import cancel_run
from upsonic.db.database import SqliteDatabase
from upsonic.session.agent import AgentSess... | 2 | assert | numeric_literal | tests/smoke_tests/hitl/test_comprehensive_hitl.py | verify_model_profile | 480 | null | |
Upsonic/Upsonic | import asyncio
import os
import sys
import time
import uuid
from typing import Any, Dict, List, Optional
from upsonic.session.agent import AgentSession, RunData
from upsonic.session.base import SessionType
from upsonic.storage.schemas import UserMemory
from upsonic.storage.mongo import AsyncMongoStorage
from upsonic.r... | 3 | assert | numeric_literal | tests/smoke_tests/memory/test_async_mongo_storage_comprehensive.py | test_session_upsert | 368 | null | |
Upsonic/Upsonic | import pytest
from upsonic import Agent, Task
from upsonic.tools import tool
from upsonic.safety_engine.policies.adult_content_policies import AdultContentBlockPolicy
from upsonic.safety_engine.policies.pii_policies import PIIBlockPolicy
from upsonic.safety_engine.policies.tool_safety_policies import (
HarmfulToolB... | None | assert | none_literal | tests/smoke_tests/agent/test_agent_policies.py | test_user_policy | 46 | null | |
Upsonic/Upsonic | import unittest
from typing import Any, List
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from upsonic import Agent, Task
from upsonic.run.agent.output import AgentRunOutput
from upsonic.models import ModelResponse, TextPart
def _make_mock_model() -> MagicMock:
mock_model: MagicMock = Magi... | str) | self.assertIsInstance | variable | tests/unit_tests/agent/test_agent_task_list.py | test_do_single_string | TestDoTaskListDispatch | 244 | null |
Upsonic/Upsonic | import pytest
import random
import string
from upsonic import Task, Agent
from upsonic.storage import Memory
from upsonic.storage.sqlite import SqliteStorage
from upsonic.safety_engine.policies.crypto_policies import CryptoBlockPolicy
from upsonic.safety_engine.policies.adult_content_policies import AdultContentBlockPo... | None | assert | none_literal | tests/smoke_tests/test_smoke_agent.py | test_agent_company_attributes | 30 | null | |
Upsonic/Upsonic | import pytest
import random
import string
from upsonic import Task, Agent
from upsonic.storage import Memory
from upsonic.storage.sqlite import SqliteStorage
from upsonic.safety_engine.policies.crypto_policies import CryptoBlockPolicy
from upsonic.safety_engine.policies.adult_content_policies import AdultContentBlockPo... | result.lower() | assert | func_call | tests/smoke_tests/test_smoke_agent.py | test_agent_company_attributes | 33 | null | |
Upsonic/Upsonic | import sys
import pytest
from rich.console import Console
from upsonic import Agent, Task, Team
pytestmark = pytest.mark.timeout(120)
def _enable_print_capture() -> None:
"""Patch Rich console to use current sys.stdout so capsys captures agent/team prints."""
import upsonic.utils.printing as _printing
_p... | out | assert | variable | tests/smoke_tests/team/test_nested_team_coordinate.py | test_coordinate_nested_team_entity_delegated | 83 | null | |
Upsonic/Upsonic | import pytest
import os
import tempfile
import shutil
from upsonic import Agent, Task
from upsonic.agent.deepagent import DeepAgent
from upsonic.agent.deepagent.backends import StateBackend, MemoryBackend, CompositeBackend
from upsonic.storage import InMemoryStorage, AsyncSqliteStorage
from io import StringIO
from cont... | 2 | assert | numeric_literal | tests/smoke_tests/deepagent/test_deepagent.py | test_deepagent_planning_and_filesystem_state_backend | 85 | null | |
Upsonic/Upsonic | import asyncio
import os
import pytest
from typing import List, Dict, Any
from upsonic import Agent, Task
from upsonic.tools import tool
from upsonic.run.events.events import (
# Base
AgentEvent,
# Pipeline events
PipelineStartEvent,
PipelineEndEvent,
# Step events
StepStartEvent... | True | assert | bool_literal | tests/smoke_tests/agent/test_stream_events.py | test_basic_text_streaming | 172 | null | |
Upsonic/Upsonic | import json
from typing import Any, List
import pytest
from upsonic.agent.context_managers.context_management_middleware import (
CONTEXT_FULL_MESSAGE,
DEFAULT_KEEP_RECENT_COUNT,
ConversationSummary,
ContextManagementMiddleware,
SummarizedRequest,
SummarizedRequestPart,
SummarizedResponse,... | "" | assert | string_literal | tests/smoke_tests/agent/test_context_management_middleware.py | test_empty_list_returns_empty_string | TestSerializeMessagesForPrompt | 544 | null |
Upsonic/Upsonic | import pytest
import os
from pathlib import Path
from upsonic import Agent, Chat, Task
from upsonic.chat import SessionState, ChatMessage, SessionMetrics, ChatAttachment
PROJECT_ROOT = Path(__file__).parent.parent.parent.parent
pytestmark = pytest.mark.timeout(120)
@pytest.mark.asyncio
async def test_chat_attachmen... | 0 | assert | numeric_literal | tests/smoke_tests/chat/test_chat.py | test_chat_attachment_class | 959 | null | |
Upsonic/Upsonic | import unittest
from unittest.mock import patch, AsyncMock, MagicMock, mock_open
import pytest
from pydantic import BaseModel
from upsonic import Direct, Task
from upsonic.models import ModelResponse, TextPart, ModelRequestParameters
from upsonic.models.settings import ModelSettings
from upsonic.profiles import ModelP... | list) | self.assertIsInstance | variable | tests/unit_tests/agent/test_direct.py | test_direct_build_messages_from_task | TestDirectInternalMethods | 414 | null |
Upsonic/Upsonic | import pytest
from io import StringIO
from contextlib import redirect_stdout
from upsonic import Agent, Task
pytestmark = pytest.mark.timeout(120)
@pytest.mark.asyncio
async def test_agent_stream_async():
"""Test Agent streaming with astream method."""
agent = Agent(model="anthropic/claude-sonnet-4-5", name=... | 0 | assert | numeric_literal | tests/smoke_tests/agent/test_agent_streaming.py | test_agent_stream_async | 34 | null | |
Upsonic/Upsonic | import pytest
from unittest.mock import patch, AsyncMock, MagicMock
from contextlib import asynccontextmanager
from upsonic import Task, Agent
from upsonic.run.agent.output import AgentRunOutput
from upsonic.models import ModelResponse, TextPart
class TestTaskStringContextHandling:
def test_task_empty_string_cont... | "" | assert | string_literal | tests/unit_tests/test_string_context.py | test_task_empty_string_context_handling | TestTaskStringContextHandling | 124 | null |
Upsonic/Upsonic | import sys
import pytest
from rich.console import Console
from io import StringIO
from contextlib import redirect_stdout
from typing import Dict
from upsonic import Agent, Task, Team, Graph
from upsonic.eval import (
PerformanceEvaluator,
PerformanceEvaluationResult,
PerformanceRunResult,
)
pytestmark = p... | graph | assert | variable | tests/smoke_tests/evals/test_performance_eval.py | test_performance_eval_graph | 307 | null | |
Upsonic/Upsonic | import os
import shutil
import subprocess
import tempfile
from pathlib import Path
from datetime import datetime
from typing import Dict, List
import pytest
from upsonic.ralph.config import RalphConfig
from upsonic.ralph.state.models import RalphState
from upsonic.ralph.state.manager import StateManager
from upsonic.... | 0 | assert | numeric_literal | tests/integration_tests/ralph/test_ralph_real_world.py | test_real_build_command_success | TestRealBackpressure | 636 | null |
Upsonic/Upsonic | import asyncio
import os
import pytest
from typing import List, Dict, Any
from upsonic import Agent, Task
from upsonic.tools import tool
from upsonic.run.events.events import (
# Base
AgentEvent,
# Pipeline events
PipelineStartEvent,
PipelineEndEvent,
# Step events
StepStartEvent... | 0 | assert | numeric_literal | tests/smoke_tests/agent/test_stream_events.py | test_basic_text_streaming | 171 | null | |
Upsonic/Upsonic | import json
from typing import Any, List
import pytest
from upsonic.agent.context_managers.context_management_middleware import (
CONTEXT_FULL_MESSAGE,
DEFAULT_KEEP_RECENT_COUNT,
ConversationSummary,
ContextManagementMiddleware,
SummarizedRequest,
SummarizedRequestPart,
SummarizedResponse,... | 4 | assert | numeric_literal | tests/smoke_tests/agent/test_context_management_middleware.py | test_full_conversation_reconstruction | TestReconstructMessages | 672 | null |
Upsonic/Upsonic | import os
import shutil
import tempfile
from pathlib import Path
from typing import Optional
import pytest
from upsonic import AutonomousAgent
from upsonic.agent import Agent
from upsonic.agent.autonomous_agent import (
AutonomousFilesystemToolKit,
AutonomousShellToolKit,
)
from upsonic.storage import InMemor... | "" | assert | string_literal | tests/smoke_tests/autonomous_agent/test_autonomous_agent.py | test_default_heartbeat_disabled | TestAutonomousAgentInitialization | 216 | null |
Upsonic/Upsonic | from typing import Any, List
import pytest
from upsonic import Agent, Task
from upsonic.run.agent.output import AgentRunOutput
def test_do_list_of_strings() -> None:
agent: Agent = Agent(model="anthropic/claude-sonnet-4-5", name="ListTester")
results: List[str] = agent.do(["What is 2+2?", "What is 3+3?"])
... | 2 | assert | numeric_literal | tests/smoke_tests/agent/test_agent_task_list.py | test_do_list_of_strings | 28 | null | |
Upsonic/Upsonic | import sys
import pytest
from rich.console import Console
from upsonic import Agent, Task, Team
pytestmark = pytest.mark.timeout(120)
def _enable_print_capture() -> None:
"""Patch Rich console to use current sys.stdout so capsys captures agent/team prints."""
import upsonic.utils.printing as _printing
_p... | out | assert | variable | tests/smoke_tests/team/test_nested_team_sequential.py | test_sequential_nested_team_entity_called | 75 | null | |
Upsonic/Upsonic | import sys
import pytest
from rich.console import Console
from io import StringIO
from contextlib import redirect_stdout
from typing import Dict
from upsonic import Agent, Task, Team, Graph
from upsonic.eval import (
PerformanceEvaluator,
PerformanceEvaluationResult,
PerformanceRunResult,
)
pytestmark = p... | team | assert | variable | tests/smoke_tests/evals/test_performance_eval.py | test_performance_eval_team_sequential | 174 | null | |
Upsonic/Upsonic | import pytest
import sqlite3
import time
from upsonic.graphv2.cache import (
InMemoryCache,
SqliteCache,
CachePolicy,
CacheEntry,
default_cache_key,
)
class TestCachePolicy:
def test_default_cache_key(self):
"""Test default cache key generation."""
state1 = {"count": 1, "messag... | key3 | assert | variable | tests/unit_tests/graph/test_graphv2_cache.py | test_default_cache_key | TestCachePolicy | 238 | null |
Upsonic/Upsonic | import sys
import pytest
from rich.console import Console
from io import StringIO
from contextlib import redirect_stdout
from typing import Dict
from upsonic import Agent, Task, Team, Graph
from upsonic.eval import (
PerformanceEvaluator,
PerformanceEvaluationResult,
PerformanceRunResult,
)
pytestmark = p... | stats | assert | variable | tests/smoke_tests/evals/test_performance_eval.py | _validate_stat_dict | 60 | null | |
Upsonic/Upsonic | import json
from typing import Any, List
import pytest
from upsonic.agent.context_managers.context_management_middleware import (
CONTEXT_FULL_MESSAGE,
DEFAULT_KEEP_RECENT_COUNT,
ConversationSummary,
ContextManagementMiddleware,
SummarizedRequest,
SummarizedRequestPart,
SummarizedResponse,... | 1 | assert | numeric_literal | tests/smoke_tests/agent/test_context_management_middleware.py | test_keep_recent_count_1 | TestPruneToolCallHistory | 444 | null |
Upsonic/Upsonic | import pytest
import os
import tempfile
import shutil
from upsonic import Agent, Task
from upsonic.agent.deepagent import DeepAgent
from upsonic.agent.deepagent.backends import StateBackend, MemoryBackend, CompositeBackend
from upsonic.storage import InMemoryStorage, AsyncSqliteStorage
from io import StringIO
from cont... | None | assert | none_literal | tests/smoke_tests/deepagent/test_deepagent.py | test_deepagent_planning_and_filesystem_state_backend | 61 | null | |
Upsonic/Upsonic | import asyncio
import os
import sys
import time
import uuid
from typing import Any, Dict, List, Optional
from upsonic.session.agent import AgentSession, RunData
from upsonic.session.base import SessionType
from upsonic.storage.schemas import UserMemory
from upsonic.storage.mongo import AsyncMongoStorage
from upsonic.r... | 5 | assert | numeric_literal | tests/smoke_tests/memory/test_async_mongo_storage_comprehensive.py | test_session_bulk_upsert | 420 | null | |
Upsonic/Upsonic | import asyncio
import pytest
from unittest.mock import patch, AsyncMock
from upsonic import Agent, Task
from upsonic.models import ModelResponse, TextPart
from upsonic.safety_engine.policies.legal_policies import (
LegalInfoBlockPolicy,
LegalInfoBlockPolicy_LLM,
LegalInfoAnonymizePolicy,
LegalInfoRepl... | result.lower() | assert | func_call | tests/unit_tests/safety_engine/test_legal_policies.py | test_legal_info_block_confidential | 59 | null | |
Upsonic/Upsonic | import pytest
import os
from pathlib import Path
from upsonic import Agent, Chat, Task
from upsonic.chat import SessionState, ChatMessage, SessionMetrics, ChatAttachment
PROJECT_ROOT = Path(__file__).parent.parent.parent.parent
pytestmark = pytest.mark.timeout(120)
@pytest.mark.asyncio
async def test_chat_conversat... | 4 | assert | numeric_literal | tests/smoke_tests/chat/test_chat.py | test_chat_conversation_history | 175 | null | |
Upsonic/Upsonic | import pytest
from upsonic import Agent, Task
pytestmark = pytest.mark.timeout(60)
@pytest.mark.asyncio
async def test_use_llm_for_selection():
"""Test that use_llm_for_selection uses LLM for model recommendations."""
# Create agent with LLM-based selection
agent = Agent(
model="openai/gpt-4o",
... | "llm" | assert | string_literal | tests/smoke_tests/test_model_selection.py | test_use_llm_for_selection | 81 | null | |
Upsonic/Upsonic | import pytest
import os
import tempfile
import json
import csv
from pathlib import Path
from typing import List
from upsonic.loaders import (
TextLoader, TextLoaderConfig,
CSVLoader, CSVLoaderConfig,
JSONLoader, JSONLoaderConfig,
XMLLoader, XMLLoaderConfig,
YAMLLoader, YAMLLoaderConfig,
Markdow... | 0 | assert | numeric_literal | tests/smoke_tests/loaders/test_loaders.py | test_basic_text_loading | TestTextLoader | 49 | null |
Upsonic/Upsonic | import pytest
from upsonic import Agent, Task
pytestmark = pytest.mark.timeout(60)
@pytest.mark.asyncio
async def test_model_selection_criteria():
"""Test that model_selection_criteria is used in model recommendations."""
# Create agent with model selection criteria
agent = Agent(
model="openai/gp... | None | assert | none_literal | tests/smoke_tests/test_model_selection.py | test_model_selection_criteria | 35 | null | |
Upsonic/Upsonic | import pytest
import os
import tempfile
import shutil
import subprocess
import sys
from pathlib import Path
pytestmark = pytest.mark.timeout(60)
def temp_dir():
"""Create a temporary directory for CLI tests."""
dir_path = tempfile.mkdtemp()
yield dir_path
shutil.rmtree(dir_path, ignore_errors=True)
d... | 1 | assert | numeric_literal | tests/smoke_tests/cli/test_cli.py | test_cli_command_dispatch | 119 | null | |
Upsonic/Upsonic | import sys
import pytest
from rich.console import Console
from io import StringIO
from contextlib import redirect_stdout
from typing import Dict
from upsonic import Agent, Task, Team, Graph
from upsonic.eval import (
PerformanceEvaluator,
PerformanceEvaluationResult,
PerformanceRunResult,
)
pytestmark = p... | 2 | assert | numeric_literal | tests/smoke_tests/evals/test_performance_eval.py | test_performance_eval_agent | 97 | null | |
Upsonic/Upsonic | import pytest
from upsonic.graphv2.store import InMemoryStore
from datetime import datetime
class TestInMemoryStore:
def test_store_get(self):
"""Test store get operation."""
store = InMemoryStore()
store.put(("user", "preferences"), "theme", "dark")
store.put(("user", "preference... | "en" | assert | string_literal | tests/unit_tests/graph/test_graphv2_store.py | test_store_get | TestInMemoryStore | 36 | null |
Upsonic/Upsonic | print(f" images count: {len(input_obj.images)}")
for i, img in enumerate(input_obj.images[:2]):
assert hasattr(img, 'data'), f"FAIL [{description}]: image[{i}] missing data"
assert hasattr(img, 'media_type'), f"FAIL [{description}]: image[{i}] missing media_type"
p... | 1 | assert | numeric_literal | tests/smoke_tests/hitl/test_comprehensive_hitl.py | test_external_tool_comprehensive | 1,125 | null | |
Upsonic/Upsonic | import asyncio
import os
import pytest
from typing import Dict, List, Set
from upsonic import Agent, Task
from upsonic.tools import tool
from upsonic.storage import InMemoryStorage, Memory
from upsonic.run.events.events import (
# Pipeline events
PipelineStartEvent,
PipelineEndEvent,
# Step event... | 1 | assert | numeric_literal | tests/smoke_tests/agent/comprehensive_event_streaming_example.py | test_cache_events | 273 | null | |
Upsonic/Upsonic | import unittest
from unittest.mock import patch, AsyncMock, MagicMock, mock_open
import pytest
from pydantic import BaseModel
from upsonic import Direct, Task
from upsonic.models import ModelResponse, TextPart, ModelRequestParameters
from upsonic.models.settings import ModelSettings
from upsonic.profiles import ModelP... | str) | self.assertIsInstance | variable | tests/unit_tests/agent/test_direct.py | test_direct_do_basic | TestDirectDoMethods | 246 | null |
Upsonic/Upsonic | import unittest
import tempfile
import os
from pathlib import Path
from upsonic.loaders.xml import XMLLoader
from upsonic.loaders.config import XMLLoaderConfig
from upsonic.schemas.data_models import Document
class TestXMLLoaderSimple(unittest.TestCase):
def setUp(self):
"""Set up test environment with sa... | doc.metadata) | self.assertIn | complex_expr | tests/unit_tests/rag/loaders/test_xml_loader_simple.py | test_metadata_inclusion | TestXMLLoaderSimple | 118 | null |
Upsonic/Upsonic | import pytest
from typing import List
from upsonic import Agent, Task
from upsonic.usage import RunUsage
def _assert_usage_positive(usage: RunUsage, label: str) -> None:
"""Assert that a RunUsage has meaningful positive values."""
assert usage.requests > 0, f"[{label}] Expected requests > 0, got {usage.reques... | 3 | assert | numeric_literal | tests/smoke_tests/agent/test_usage_tracking.py | test_multiple_agent_tools_usage_tracking | 495 | null | |
Upsonic/Upsonic | import pytest
import os
from pathlib import Path
from upsonic import Agent, Chat, Task
from upsonic.chat import SessionState, ChatMessage, SessionMetrics, ChatAttachment
PROJECT_ROOT = Path(__file__).parent.parent.parent.parent
pytestmark = pytest.mark.timeout(120)
@pytest.mark.asyncio
async def test_chat_message_t... | 2 | assert | numeric_literal | tests/smoke_tests/chat/test_chat.py | test_chat_message_to_dict | 1,011 | null | |
Upsonic/Upsonic | import sys
import pytest
import asyncio
from unittest.mock import Mock, patch, AsyncMock
from typing import List, Dict, Any
from upsonic.knowledge_base.knowledge_base import KnowledgeBase
from upsonic.vectordb.providers.chroma import ChromaProvider
from upsonic.vectordb.config import ChromaConfig, ConnectionConfig, Mo... | "id1" | assert | string_literal | tests/unit_tests/rag/vectordb/test_chroma_knowledge_base.py | test_chroma_upsert_operations | TestChromaKnowledgeBaseIntegration | 174 | null |
Upsonic/Upsonic | import pytest
import asyncio
from unittest.mock import AsyncMock, MagicMock, patch, PropertyMock
from typing import List, Any, AsyncIterator
from upsonic.chat import Chat, SessionState, ChatMessage
from upsonic.tasks.tasks import Task
from upsonic.storage.in_memory import InMemoryStorage
class TestChatInitialization:... | agent | assert | variable | tests/unit_tests/chat/test_chat.py | test_chat_init_basic | TestChatInitialization | 75 | null |
Upsonic/Upsonic | import pytest
from upsonic.graph.graph import (
Graph,
TaskNode,
TaskChain,
DecisionFunc,
DecisionLLM,
State,
)
from upsonic.tasks.tasks import Task
from upsonic.agent.base import BaseAgent
class TestGraphAddTask:
def test_graph_add_task(self):
"""Test adding a Task to graph."""
... | task | assert | variable | tests/unit_tests/graph/test_graph.py | test_graph_add_task | TestGraphAddTask | 88 | null |
Upsonic/Upsonic | import pytest
import asyncio
from io import StringIO
from contextlib import redirect_stdout
from upsonic import Agent, Task, Graph, Direct
from upsonic.graph.graph import TaskNode, DecisionFunc, DecisionLLM
pytestmark = pytest.mark.timeout(180)
@pytest.mark.asyncio
async def test_graph_initialization():
"""Test ... | 8 | assert | numeric_literal | tests/smoke_tests/graphv1/test_graph.py | test_graph_initialization | 35 | null | |
Upsonic/Upsonic | import sys
import pytest
from rich.console import Console
from io import StringIO
from contextlib import redirect_stdout
from upsonic import Agent, Task, Team, Graph
from upsonic.eval import AccuracyEvaluator, AccuracyEvaluationResult, EvaluationScore
pytestmark = pytest.mark.timeout(300)
def _enable_print_capture()... | None | assert | none_literal | tests/smoke_tests/evals/test_accuracy_eval.py | _validate_accuracy_result | 30 | null | |
Upsonic/Upsonic | import asyncio
import os
import sys
import time
from typing import Any, Dict, List, Optional
from upsonic.session.agent import AgentSession, RunData
from upsonic.session.base import SessionType
from upsonic.storage.schemas import UserMemory
from upsonic.storage.mem0 import AsyncMem0Storage
from upsonic.run.agent.outpu... | 0 | assert | numeric_literal | tests/smoke_tests/memory/test_async_mem0_storage_comprehensive.py | assert_session_dict_fields | 182 | null | |
Upsonic/Upsonic | import sys
import pytest
from rich.console import Console
from io import StringIO
from contextlib import redirect_stdout
from upsonic import Agent, Task, Team, Graph
from upsonic.eval import AccuracyEvaluator, AccuracyEvaluationResult, EvaluationScore
pytestmark = pytest.mark.timeout(300)
def _enable_print_capture()... | judge | assert | variable | tests/smoke_tests/evals/test_accuracy_eval.py | test_accuracy_eval_agent | 93 | null | |
Upsonic/Upsonic | import pytest
from upsonic import Agent, Task
from upsonic.culture import Culture, CultureManager
def test_culture_repeat_settings():
"""Test Culture with repeat enabled."""
print("\n" + "=" * 70)
print("TEST 7: Culture Repeat Settings")
print("=" * 70)
culture_with_repeat = Culture(
d... | 1 | assert | numeric_literal | tests/smoke_tests/culture/test_culture_usage.py | test_culture_repeat_settings | 225 | null | |
Upsonic/Upsonic | import pytest
import random
import string
from upsonic import Task, Agent
from upsonic.storage import Memory
from upsonic.storage.sqlite import SqliteStorage
from upsonic.safety_engine.policies.crypto_policies import CryptoBlockPolicy
from upsonic.safety_engine.policies.adult_content_policies import AdultContentBlockPo... | '2952' | assert | string_literal | tests/smoke_tests/test_smoke_agent.py | test_agent_memory_and_task_chaining | 89 | null | |
Upsonic/Upsonic | import unittest
from typing import Any, List
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from upsonic import Agent, Task
from upsonic.run.agent.output import AgentRunOutput
from upsonic.models import ModelResponse, TextPart
def _make_mock_model() -> MagicMock:
mock_model: MagicMock = Magi... | task) | self.assertIs | variable | tests/unit_tests/agent/test_agent_task_list.py | test_non_list_returns_unhandled | TestHandleTaskListSync | 64 | null |
Upsonic/Upsonic | import asyncio
import unittest
from unittest.mock import patch, AsyncMock, MagicMock, PropertyMock
from upsonic import Task, Agent
from upsonic.exceptions import ExecutionTimeoutError
from upsonic.run.agent.output import AgentRunOutput
class TestNoTimeoutBackwardCompatibility(unittest.TestCase):
@patch('upsonic.... | "") | self.assertNotEqual | string_literal | tests/unit_tests/test_partial_timeout.py | test_do_without_timeout_works_normally | TestNoTimeoutBackwardCompatibility | 262 | null |
Upsonic/Upsonic | import asyncio
import os
import pytest
from unittest.mock import patch, AsyncMock
from contextlib import asynccontextmanager
from upsonic import Agent, Task
from upsonic.run.agent.output import AgentRunOutput
from upsonic.models import ModelResponse, TextPart
from upsonic.safety_engine import (
RuleBase,
Acti... | result.lower() | assert | func_call | tests/unit_tests/safety_engine/test_fraud_detection_policies.py | test_fraud_detection_block_pyramid_scheme | 71 | null | |
Upsonic/Upsonic | import os
import shutil
import subprocess
import tempfile
from pathlib import Path
from datetime import datetime
from typing import Dict, List
import pytest
from upsonic.ralph.config import RalphConfig
from upsonic.ralph.state.models import RalphState
from upsonic.ralph.state.manager import StateManager
from upsonic.... | 2 | assert | numeric_literal | tests/integration_tests/ralph/test_ralph_real_world.py | test_real_validation_stops_on_first_failure | TestRealBackpressure | 761 | null |
Upsonic/Upsonic | import pytest
import tempfile
import os
from pathlib import Path
from upsonic import Agent, Task
from upsonic.knowledge_base import KnowledgeBase
from upsonic.embeddings import OpenAIEmbedding
from upsonic.vectordb import ChromaProvider
from io import StringIO
from contextlib import redirect_stdout
pytestmark = pytest... | 0 | assert | numeric_literal | tests/smoke_tests/knowledgebase/test_knowledgebase_as_tool.py | test_knowledgebase_in_task_tools | 143 | null | |
Upsonic/Upsonic | import unittest
import tempfile
import os
from pathlib import Path
from upsonic.loaders.markdown import MarkdownLoader
from upsonic.loaders.config import MarkdownLoaderConfig
from upsonic.schemas.data_models import Document
class TestMarkdownLoaderSimple(unittest.TestCase):
def setUp(self):
"""Set up test... | "h2") | self.assertEqual | string_literal | tests/unit_tests/rag/loaders/test_markdown_loader_simple.py | test_markdown_config_options | TestMarkdownLoaderSimple | 107 | null |
Upsonic/Upsonic | assert len(loaded.images) == len(expected.images), \
f"{test_name}: images length mismatch: {len(loaded.images)} != {len(expected.images)}"
for i, (li, ei) in enumerate(zip(loaded.images, expected.images)):
assert li.data == ei.data, f"{test_name}: images[{i}].data mismatch"
... | oa | assert | variable | tests/smoke_tests/memory/test_storage_agentsession_comprehensive.py | _test_attribute_upsert | 1,222 | null | |
Upsonic/Upsonic | import asyncio
import os
import pytest
from unittest.mock import patch, AsyncMock
from contextlib import asynccontextmanager
from upsonic import Agent, Task
from upsonic.run.agent.output import AgentRunOutput
from upsonic.models import ModelResponse, TextPart
from upsonic.safety_engine import (
RuleBase,
Acti... | result.lower() | assert | func_call | tests/unit_tests/safety_engine/test_insider_threat_policies.py | test_insider_threat_block_data_exfiltration | 71 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.