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
containers/ramalama
from types import SimpleNamespace from unittest import mock import pytest from ramalama.chat_providers.openai import OpenAIResponsesChatProvider from ramalama.config import get_config from ramalama.transports import api as api_module from ramalama.transports.api import APITransport CONFIG = get_config() def make_pr...
ValueError)
pytest.raises
variable
test/unit/test_api_transport.py
test_api_transport_ensure_exists_raises_if_model_missing
91
null
containers/ramalama
import json import pytest from ramalama.chat_providers.base import ChatRequestOptions from ramalama.chat_providers.openai import OpenAICompletionsChatProvider, OpenAIResponsesChatProvider from ramalama.chat_utils import AssistantMessage, ImageURLPart, ToolCall, ToolMessage, UserMessage def build_payload(content): ...
"call-9"
assert
string_literal
test/unit/providers/test_openai_provider.py
test_serializes_tool_calls
OpenAIResponsesProviderTests
123
null
containers/ramalama
import platform import re from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest from ramalama.path_utils import normalize_host_path_for_container from test.conftest import ( skip_if_docker, skip_if_no_container, skip_if_not_windows, skip_if_ppc64le, skip_if_s390x...
expected
assert
variable
test/e2e/test_rag.py
test_rag_dry_run
77
null
containers/ramalama
from types import SimpleNamespace from unittest import mock import pytest from ramalama.chat_providers.openai import OpenAIResponsesChatProvider from ramalama.config import get_config from ramalama.transports import api as api_module from ramalama.transports.api import APITransport CONFIG = get_config() def make_pr...
provider
assert
variable
test/unit/test_api_transport.py
test_api_transport_run
40
null
containers/ramalama
import json import platform import re from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest from test.conftest import skip_if_docker, skip_if_no_container, skip_if_podman_too_old, skip_if_windows from test.e2e.utils import RamalamaExecWorkspace, check_output def path_to_uri(path): ...
size1
assert
variable
test/e2e/test_artifact.py
test_artifact_overwrite_same_name
584
null
containers/ramalama
import socket from argparse import Namespace from unittest.mock import MagicMock, Mock, patch import pytest from ramalama.command.factory import assemble_command from ramalama.common import MNT_DIR from ramalama.config import get_config from ramalama.transports.base import Transport, compute_ports, compute_serving_po...
expectedErr)
pytest.raises
variable
test/unit/test_transport_base.py
test_compute_serving_port
166
null
containers/ramalama
import tempfile from unittest.mock import patch import pytest from ramalama.arg_types import StoreArgs from ramalama.model_store.snapshot_file import LocalSnapshotFile, SnapshotFile, SnapshotFileType from ramalama.transports.ollama import Ollama, OllamaRepository def ollama_model(args: StoreArgs): return Ollama(...
"llama2:7b"
assert
string_literal
test/unit/test_ollama.py
test_ollama_model_initialization
23
null
containers/ramalama
import os import shutil import subprocess from contextlib import ExitStack from pathlib import Path from sys import platform from unittest.mock import MagicMock, Mock, mock_open, patch import pytest from ramalama.cli import configure_subcommands, create_argument_parser, default_image, default_rag_image from ramalama....
2
assert
numeric_literal
test/unit/test_common.py
test_populate_volume_success
TestPopulateVolumeFromImage
450
null
containers/ramalama
import os import tempfile from unittest.mock import MagicMock, patch import pytest from ramalama.chat import RamaLamaShell, chat from ramalama.chat_utils import ImageURLPart def _text_content(message): return message.text or "" class TestImageUploadChatIntegration: @patch('urllib.request.urlopen') def ...
2
assert
numeric_literal
test/unit/test_file_loader_integration.py
test_chat_with_image_input_directory
TestImageUploadChatIntegration
339
null
containers/ramalama
import socket from argparse import Namespace from unittest.mock import MagicMock, Mock, patch import pytest from ramalama.command.factory import assemble_command from ramalama.common import MNT_DIR from ramalama.config import get_config from ramalama.transports.base import Transport, compute_ports, compute_serving_po...
res
assert
variable
test/unit/test_transport_base.py
test_compute_ports
103
null
containers/ramalama
import socket from argparse import Namespace from unittest.mock import MagicMock, Mock, patch import pytest from ramalama.command.factory import assemble_command from ramalama.common import MNT_DIR from ramalama.config import get_config from ramalama.transports.base import Transport, compute_ports, compute_serving_po...
first
assert
variable
test/unit/test_transport_base.py
test_compute_ports_exclude
119
null
containers/ramalama
from dataclasses import dataclass, field import pytest from ramalama.model_store.snapshot_file import SnapshotFile from ramalama.transports.url import URL @pytest.mark.parametrize( "input,expected", [ (Input(""), Expected()), (Input("file:///tmp/models/granite-3b-code-base.Q4_K_M.gguf"), Expe...
len(expected.URLList)
assert
func_call
test/unit/test_url.py
test__assemble_split_file_list
54
null
containers/ramalama
import socket from argparse import Namespace from unittest.mock import MagicMock, Mock, patch import pytest from ramalama.command.factory import assemble_command from ramalama.common import MNT_DIR from ramalama.config import get_config from ramalama.transports.base import Transport, compute_ports, compute_serving_po...
expected_name
assert
variable
test/unit/test_transport_base.py
test_extract_model_identifiers
93
null
containers/ramalama
import json import platform import re from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest from test.conftest import skip_if_docker, skip_if_no_container, skip_if_podman_too_old, skip_if_windows from test.e2e.utils import RamalamaExecWorkspace, check_output def path_to_uri(path): ...
2
assert
numeric_literal
test/e2e/test_artifact.py
test_convert_error_invalid_type
77
null
containers/ramalama
import os import pytest from ramalama.common import generate_sha256_binary from ramalama.model_store.global_store import GlobalModelStore from ramalama.model_store.reffile import RefJSONFile, StoreFile, StoreFileType from ramalama.model_store.snapshot_file import ( LocalSnapshotFile, SnapshotFile, Snapsho...
content
assert
variable
test/unit/test_model_store.py
test_local_snapshot_file_binary_download_and_digest
111
null
containers/ramalama
import io import os from pathlib import Path from typing import Optional import pytest from ramalama.quadlet import Quadlet @pytest.mark.parametrize( "input,expected_files_path", [ ( Input( model_name="tinyllama", model_src_blob="sha256-2af3b81862c6be03c769...
dict()
assert
func_call
test/unit/test_quadlet.py
test_quadlet_generate
273
null
containers/ramalama
import json import random import re import string from pathlib import Path, PurePosixPath from subprocess import STDOUT, CalledProcessError import pytest from ramalama.path_utils import normalize_host_path_for_container from test.conftest import ( skip_if_big_endian_machine, skip_if_darwin, skip_if_little...
expected
assert
variable
test/e2e/test_pull.py
test_pull_using_ollama_cache
256
null
containers/ramalama
import platform import re from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest from ramalama.path_utils import normalize_host_path_for_container from test.conftest import ( skip_if_docker, skip_if_no_container, skip_if_not_windows, skip_if_ppc64le, skip_if_s390x...
required
assert
variable
test/e2e/test_rag.py
test_rag_dry_run_user_flag
152
null
containers/ramalama
import os import shutil import subprocess from contextlib import ExitStack from pathlib import Path from sys import platform from unittest.mock import MagicMock, Mock, mock_open, patch import pytest from ramalama.cli import configure_subcommands, create_argument_parser, default_image, default_rag_image from ramalama....
"none"
assert
string_literal
test/unit/test_common.py
test_default_get_accel
TestGetAccel
222
null
containers/ramalama
import sys from argparse import Namespace from unittest import mock import pytest from ramalama.cli import ParsedGenerateInput, parse_generate_option, post_parse_setup from ramalama.transports.base import NoGGUFModelFileFound, SafetensorModelNotSupported @pytest.mark.parametrize( "exc_type", [ NoGGUF...
SystemExit)
pytest.raises
variable
test/unit/test_cli.py
test_main_doesnt_crash_on_exc
151
null
containers/ramalama
import json import random import re import string from pathlib import Path, PurePosixPath from subprocess import STDOUT, CalledProcessError import pytest from ramalama.path_utils import normalize_host_path_for_container from test.conftest import ( skip_if_big_endian_machine, skip_if_darwin, skip_if_little...
expected_name
assert
variable
test/e2e/test_pull.py
test_pull
143
null
containers/ramalama
import os import shutil import subprocess from contextlib import ExitStack from pathlib import Path from sys import platform from unittest.mock import MagicMock, Mock, mock_open, patch import pytest from ramalama.cli import configure_subcommands, create_argument_parser, default_image, default_rag_image from ramalama....
([], ["all"])
assert
collection
test/unit/test_common.py
test_find_in_cdi_no_config
411
null
containers/ramalama
import pytest import ramalama.toml_parser @pytest.mark.parametrize( "toml, expected", [ ( """ [store] processes = 1 float_value = 1.0 use_engine = True image = "my_image" numbers = [1, 2, 3] """, ...
expected["store"]["image"]
assert
complex_expr
test/unit/test_toml_parser.py
test_toml_parser_basic_parse_different_types
72
null
containers/ramalama
import os from unittest.mock import patch import pytest from ramalama.config import ( BaseConfig, RamalamaImages, default_config, get_config, get_default_engine, get_default_store, load_env_config, ) from ramalama.log_levels import LogLevel config = get_config() def isolate_config(): ...
8
assert
numeric_literal
test/unit/test_config.py
test_file_config_overrides_defaults
110
null
containers/ramalama
import json import pytest from ramalama.chat_providers.base import ChatRequestOptions from ramalama.chat_providers.openai import OpenAICompletionsChatProvider, OpenAIResponsesChatProvider from ramalama.chat_utils import AssistantMessage, ImageURLPart, ToolCall, ToolMessage, UserMessage def build_payload(content): ...
"hello"
assert
string_literal
test/unit/providers/test_openai_provider.py
test_extracts_string_and_structured_deltas
OpenAICompletionsProviderTests
33
null
containers/ramalama
import pytest import ramalama.toml_parser @pytest.mark.parametrize( "toml, expected", [ ( """ [store] processes = 1 float_value = 1.0 use_engine = True image = "my_image" numbers = [1, 2, 3] """, ...
expected["store"]["processes"]
assert
complex_expr
test/unit/test_toml_parser.py
test_toml_parser_basic_parse_different_types
70
null
containers/ramalama
import os import shutil import subprocess from contextlib import ExitStack from pathlib import Path from sys import platform from unittest.mock import MagicMock, Mock, mock_open, patch import pytest from ramalama.cli import configure_subcommands, create_argument_parser, default_image, default_rag_image from ramalama....
subprocess.CalledProcessError)
pytest.raises
complex_expr
test/unit/test_common.py
test_populate_volume_export_failure
TestPopulateVolumeFromImage
472
null
containers/ramalama
import socket from argparse import Namespace from unittest.mock import MagicMock, Mock, patch import pytest from ramalama.command.factory import assemble_command from ramalama.common import MNT_DIR from ramalama.config import get_config from ramalama.transports.base import Transport, compute_ports, compute_serving_po...
count
assert
variable
test/unit/test_transport_base.py
test_compute_ports_exclude
118
null
containers/ramalama
import json import pytest from ramalama.chat_providers.base import ChatRequestOptions from ramalama.chat_providers.openai import OpenAICompletionsChatProvider, OpenAIResponsesChatProvider from ramalama.chat_utils import AssistantMessage, ImageURLPart, ToolCall, ToolMessage, UserMessage def build_payload(content): ...
"Hi"
assert
string_literal
test/unit/providers/test_openai_provider.py
test_streaming_emits_delta_and_completion_events
OpenAIResponsesProviderTests
110
null
containers/ramalama
import itertools import json import logging import os import platform import random import re import string import time from contextlib import contextmanager from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest import yaml from test.conftest import ( skip_if_container, skip...
1
assert
numeric_literal
test/e2e/test_serve.py
test_quadlet_and_kube_generation_with_container_registry
551
null
containers/ramalama
import json import platform import re from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest from test.conftest import skip_if_docker, skip_if_no_container, skip_if_podman_too_old, skip_if_windows from test.e2e.utils import RamalamaExecWorkspace, check_output def path_to_uri(path): ...
result
assert
variable
test/e2e/test_artifact.py
test_convert_help_shows_types
165
null
containers/ramalama
import json import pytest from ramalama.chat_providers.base import ChatRequestOptions from ramalama.chat_providers.openai import OpenAICompletionsChatProvider, OpenAIResponsesChatProvider from ramalama.chat_utils import AssistantMessage, ImageURLPart, ToolCall, ToolMessage, UserMessage def build_payload(content): ...
"call-1"
assert
string_literal
test/unit/providers/test_openai_provider.py
test_serializes_tool_calls_and_responses
OpenAICompletionsProviderTests
78
null
containers/ramalama
from dataclasses import dataclass, field from typing import Any, Dict, List from ramalama.layered_config import LayeredMixin, build_subconfigs, deep_merge, extract_defaults def default_simple_config() -> SimpleConfig: return SimpleConfig(name="default_simple", value=42) def default_nested_config() -> NestedConfi...
{}
assert
collection
test/unit/test_layered_config.py
test_extract_defaults_without_defaults
TestExtractDefaults
65
null
containers/ramalama
import unittest from argparse import Namespace from http.client import HTTPException from json import JSONDecodeError from subprocess import TimeoutExpired from unittest.mock import Mock, patch import pytest import ramalama.engine @patch("ramalama.engine.HTTPConnection") def test_is_healthy_conn(mock_conn): args...
args.port)
assert_*
complex_expr
test/unit/test_engine.py
test_is_healthy_conn
121
null
containers/ramalama
import argparse import os from dataclasses import dataclass, field from pathlib import Path from unittest.mock import MagicMock import pytest from ramalama.command.context import ( RamalamaArgsContext, RamalamaCommandContext, RamalamaHostContext, RamalamaModelContext, ) from ramalama.command.error imp...
expected_cmd
assert
variable
test/unit/command/test_factory.py
test_command_factory
149
null
containers/ramalama
import tempfile from unittest.mock import patch import pytest from ramalama.arg_types import StoreArgs from ramalama.model_store.snapshot_file import LocalSnapshotFile, SnapshotFile, SnapshotFileType from ramalama.transports.ollama import Ollama, OllamaRepository def ollama_model(args: StoreArgs): return Ollama(...
"Ollama"
assert
string_literal
test/unit/test_ollama.py
test_ollama_model_initialization
24
null
containers/ramalama
import os from unittest.mock import patch import pytest from ramalama.config import ( BaseConfig, RamalamaImages, default_config, get_config, get_default_engine, get_default_store, load_env_config, ) from ramalama.log_levels import LogLevel config = get_config() def isolate_config(): ...
2
assert
numeric_literal
test/unit/test_config.py
test_config_type_coercion
TestConfigIntegration
632
null
containers/ramalama
import json import random import re import string from pathlib import Path, PurePosixPath from subprocess import STDOUT, CalledProcessError import pytest from ramalama.path_utils import normalize_host_path_for_container from test.conftest import ( skip_if_big_endian_machine, skip_if_darwin, skip_if_little...
1
assert
numeric_literal
test/e2e/test_pull.py
test_pull_wrong_endian_model_error
204
null
containers/ramalama
import sys from argparse import Namespace from unittest import mock import pytest from ramalama.cli import ParsedGenerateInput, parse_generate_option, post_parse_setup from ramalama.transports.base import NoGGUFModelFileFound, SafetensorModelNotSupported @pytest.mark.parametrize( "input_args, expected_initial, e...
input_args.MODEL
assert
complex_expr
test/unit/test_cli.py
test_post_parse_setup_model_input
237
null
containers/ramalama
import os import pytest from ramalama.common import generate_sha256_binary from ramalama.model_store.global_store import GlobalModelStore from ramalama.model_store.reffile import RefJSONFile, StoreFile, StoreFileType from ramalama.model_store.snapshot_file import ( LocalSnapshotFile, SnapshotFile, Snapsho...
snapshot_hash
assert
variable
test/unit/test_model_store.py
test_try_convert_existing_chat_template_converts_flat_jinja
86
null
containers/ramalama
from dataclasses import dataclass from typing import Union import pytest import ramalama.transports.transport_factory as transport_factory_module from ramalama.chat_providers.openai import OpenAIResponsesChatProvider from ramalama.transports.api import APITransport from ramalama.transports.huggingface import Huggingf...
expected
assert
variable
test/unit/test_transport_factory.py
test_prune_model_input
171
null
containers/ramalama
import subprocess import tempfile import warnings from unittest.mock import Mock, patch import pytest from ramalama.arg_types import StoreArgs from ramalama.transports.rlcr import RamalamaContainerRegistry, find_model_file_in_image def suppress_rlcr_warnings(): """Suppress expected warnings from RLCR model file ...
"podman"
assert
string_literal
test/unit/test_rlcr.py
test_rlcr_model_initialization
TestRLCRInitialization
51
null
containers/ramalama
import urllib.request from unittest.mock import MagicMock, patch import pytest from ramalama.proxy_support import _get_proxy_env, _is_socks_proxy, get_proxy_info, setup_proxy_support def clearenv(monkeypatch): # Clear any proxy env vars that might exist for var in [ 'http_proxy', 'HTTP_PROXY'...
{}
assert
collection
test/unit/test_proxy_support.py
test_no_proxy_env_vars
TestGetProxyEnv
34
null
containers/ramalama
import json import re from datetime import datetime import pytest from test.e2e.utils import RamalamaExecWorkspace HEADING_REGEX = "NAME *MODIFIED *SIZE" TEST_IMAGE = "ollama://smollm:135m" def shared_ctx(): """Provides an isolated and shared context for all tests in the module. Creates a ramalama workspac...
""
assert
string_literal
test/e2e/test_list.py
test_all_images_removed
66
null
containers/ramalama
import json import pytest from ramalama.benchmarks import manager, schemas def _make_config(engine: str) -> schemas.TestConfigurationV1: return schemas.TestConfigurationV1( container_image="quay.io/ramalama/ramalama:latest", container_runtime="docker", inference_engine=engine, run...
"engine-b"
assert
string_literal
test/unit/test_benchmarks_manager.py
test_list_returns_saved_records_in_order
106
null
containers/ramalama
import unittest from argparse import Namespace from http.client import HTTPException from json import JSONDecodeError from subprocess import TimeoutExpired from unittest.mock import Mock, patch import pytest import ramalama.engine @pytest.mark.parametrize( "status, ok", [ (500, False), (404, ...
('GET', '/ping')
assert
collection
test/unit/test_engine.py
test_is_healthy_vllm
209
null
containers/ramalama
import random import re from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest from test.e2e.utils import RamalamaExecWorkspace, check_output @pytest.mark.e2e def test_delete_snapshot_with_multiple_references(): with RamalamaExecWorkspace() as ctx: initial_inventory = se...
inventory_a
assert
variable
test/e2e/test_rm.py
test_delete_snapshot_with_multiple_references
46
null
containers/ramalama
import json import pytest from ramalama.chat_providers.base import ChatRequestOptions from ramalama.chat_providers.openai import OpenAICompletionsChatProvider, OpenAIResponsesChatProvider from ramalama.chat_utils import AssistantMessage, ImageURLPart, ToolCall, ToolMessage, UserMessage def build_payload(content): ...
1
assert
numeric_literal
test/unit/providers/test_openai_provider.py
test_streaming_handles_structured_chunks
OpenAICompletionsProviderTests
59
null
containers/ramalama
import json import platform import re from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest from test.conftest import skip_if_docker, skip_if_no_container, skip_if_podman_too_old, skip_if_windows from test.e2e.utils import RamalamaExecWorkspace, check_output def path_to_uri(path): ...
[2, 22]
assert
collection
test/e2e/test_artifact.py
test_convert_nocontainer_error
116
null
containers/ramalama
import itertools import json import logging import os import platform import random import re import string import time from contextlib import contextmanager from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest import yaml from test.conftest import ( skip_if_container, skip...
2
assert
numeric_literal
test/e2e/test_serve.py
test_generation_with_bad_id
436
null
containers/ramalama
import json import os import platform import re import string from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest from ramalama.version import version as ramalama_version from test.conftest import skip_if_no_container from test.e2e.utils import RamalamaExecWorkspace, check_output,...
2
assert
numeric_literal
test/e2e/test_help.py
test_container_engine_flag_validation
209
null
containers/ramalama
import os from unittest.mock import patch import pytest from ramalama.config import ( BaseConfig, RamalamaImages, default_config, get_config, get_default_engine, get_default_store, load_env_config, ) from ramalama.log_levels import LogLevel config = get_config() def isolate_config(): ...
-1
assert
numeric_literal
test/unit/test_config.py
test_correct_config_defaults
48
null
containers/ramalama
import argparse from unittest.mock import patch import pytest from ramalama.command.context import RamalamaArgsContext from ramalama.config import default_config class TestMaxTokensConfig: def test_max_tokens_negative_value(self): """Test that max_tokens accepts negative values (though they may be treat...
"-1"
assert
string_literal
test/unit/test_max_tokens.py
test_max_tokens_negative_value
TestMaxTokensConfig
78
null
containers/ramalama
import os from unittest.mock import patch import pytest from ramalama.config import ( BaseConfig, RamalamaImages, default_config, get_config, get_default_engine, get_default_store, load_env_config, ) from ramalama.log_levels import LogLevel config = get_config() def isolate_config(): ...
None
assert
none_literal
test/unit/test_config.py
test_base_config_accepts_none_log_level
185
null
containers/ramalama
import random import re from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest from test.e2e.utils import RamalamaExecWorkspace, check_output @pytest.mark.e2e def test_delete_non_existing_image_with_ignore_flag(): image_name = f"rm_random_image_{random.randint(0, 9999)}" res...
""
assert
string_literal
test/e2e/test_rm.py
test_delete_non_existing_image_with_ignore_flag
28
null
containers/ramalama
import json import tempfile from pathlib import Path import pytest from ramalama.version import version from test.conftest import skip_if_gh_actions_darwin from test.e2e.utils import RamalamaExecWorkspace, check_output @pytest.mark.e2e @pytest.mark.distro_integration @skip_if_gh_actions_darwin @pytest.mark.parametri...
str(expected_value)
assert
func_call
test/e2e/test_info.py
test_info_with_params
46
null
containers/ramalama
import json import pytest from ramalama.chat_providers.base import ChatRequestOptions from ramalama.chat_providers.openai import OpenAICompletionsChatProvider, OpenAIResponsesChatProvider from ramalama.chat_utils import AssistantMessage, ImageURLPart, ToolCall, ToolMessage, UserMessage def build_payload(content): ...
payload
assert
variable
test/unit/providers/test_openai_provider.py
test_serializes_structured_content
OpenAIResponsesProviderTests
98
null
containers/ramalama
import pytest import ramalama.toml_parser @pytest.mark.parametrize( "toml, expected", [ ( """ [store] container = "podman" engine = "podman" image = "example_image" transport = "oci" [store.extra] extra_key...
expected["store"]
assert
complex_expr
test/unit/test_toml_parser.py
test_toml_parser_get
106
null
containers/ramalama
import json import pytest from ramalama.chat_providers.base import ChatRequestOptions from ramalama.chat_providers.openai import OpenAICompletionsChatProvider, OpenAIResponsesChatProvider from ramalama.chat_utils import AssistantMessage, ImageURLPart, ToolCall, ToolMessage, UserMessage def build_payload(content): ...
"lookup"
assert
string_literal
test/unit/providers/test_openai_provider.py
test_serializes_tool_calls_and_responses
OpenAICompletionsProviderTests
76
null
containers/ramalama
import os import tempfile from unittest.mock import MagicMock, patch import pytest from ramalama.chat import RamaLamaShell, chat from ramalama.chat_utils import ImageURLPart def _text_content(message): return message.text or "" class TestFileUploadChatIntegration: @patch('urllib.request.urlopen') def t...
text
assert
variable
test/unit/test_file_loader_integration.py
test_chat_with_file_input_empty_file
TestFileUploadChatIntegration
138
null
containers/ramalama
import argparse from unittest.mock import patch import pytest from ramalama.command.context import RamalamaArgsContext from ramalama.config import default_config class TestMaxTokensCLI: def test_max_tokens_cli_argument_parsing(self): """Test that --max-tokens argument is properly parsed.""" pars...
0
assert
numeric_literal
test/unit/test_max_tokens.py
test_max_tokens_cli_argument_parsing
TestMaxTokensCLI
100
null
containers/ramalama
import unittest from argparse import Namespace from http.client import HTTPException from json import JSONDecodeError from subprocess import TimeoutExpired from unittest.mock import Mock, patch import pytest import ramalama.engine class TestEngine(unittest.TestCase): def setUp(self): self.base_args = Nam...
engine.exec_args)
self.assertIn
complex_expr
test/unit/test_engine.py
test_add_privileged_options
TestEngine
75
null
containers/ramalama
import json import random import re import string from pathlib import Path, PurePosixPath from subprocess import STDOUT, CalledProcessError import pytest from ramalama.path_utils import normalize_host_path_for_container from test.conftest import ( skip_if_big_endian_machine, skip_if_darwin, skip_if_little...
output
assert
variable
test/e2e/test_pull.py
test_pull_model_layers_download
156
null
containers/ramalama
import argparse from typing import Any from unittest.mock import MagicMock import pytest from ramalama.command import context def test_ramalama_model_context_without_draft_model(): # Pass in a dummy model which does not have the draft_model attribute class DummyModel: pass ctx = context.Ramalama...
""
assert
string_literal
test/unit/command/test_context.py
test_ramalama_model_context_without_draft_model
120
null
containers/ramalama
import pytest import ramalama.toml_parser @pytest.mark.parametrize( "toml, expected", [ ( """ [store] container = "docker" engine = "docker" image = "my_image" transport = "oci" """, { "stor...
expected
assert
variable
test/unit/test_toml_parser.py
test_toml_parser_basic_parse
37
null
containers/ramalama
import itertools import json import logging import os import platform import random import re import string import time from contextlib import contextmanager from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest import yaml from test.conftest import ( skip_if_container, skip...
container_spec
assert
variable
test/e2e/test_serve.py
test_quadlet_and_kube_generation_with_container_registry
553
null
containers/ramalama
import socket from argparse import Namespace from unittest.mock import MagicMock, Mock, patch import pytest from ramalama.command.factory import assemble_command from ramalama.common import MNT_DIR from ramalama.config import get_config from ramalama.transports.base import Transport, compute_ports, compute_serving_po...
expectedOutput
assert
variable
test/unit/test_transport_base.py
test_compute_serving_port
171
null
containers/ramalama
import unittest from argparse import Namespace from http.client import HTTPException from json import JSONDecodeError from subprocess import TimeoutExpired from unittest.mock import Mock, patch import pytest import ramalama.engine @pytest.mark.parametrize( "health_status, models_status, models_body, models_msg",...
len(responses)
assert
func_call
test/unit/test_engine.py
test_is_healthy_fail
156
null
containers/ramalama
import unittest from argparse import Namespace from http.client import HTTPException from json import JSONDecodeError from subprocess import TimeoutExpired from unittest.mock import Mock, patch import pytest import ramalama.engine class TestEngine(unittest.TestCase): def setUp(self): self.base_args = Nam...
exec_args)
self.assertNotIn
variable
test/unit/test_engine.py
test_add_container_labels
TestEngine
34
null
containers/ramalama
import os import tempfile from unittest.mock import mock_open, patch import pytest from ramalama.chat_utils import ImageURLPart from ramalama.file_loaders.file_manager import ImageFileManager, OpanAIChatAPIMessageBuilder, TextFileManager from ramalama.file_loaders.file_types.base import BaseFileLoader from ramalama.f...
1
assert
numeric_literal
test/unit/test_file_loader.py
test_image_file_manager_load_single_image_file
TestImageFileManager
156
null
containers/ramalama
import subprocess import tempfile import warnings from unittest.mock import Mock, patch import pytest from ramalama.arg_types import StoreArgs from ramalama.transports.rlcr import RamalamaContainerRegistry, find_model_file_in_image def suppress_rlcr_warnings(): """Suppress expected warnings from RLCR model file ...
"model1.gguf"
assert
string_literal
test/unit/test_rlcr.py
test_find_model_file_with_no_value_label
TestModelFileDiscovery
93
null
containers/ramalama
import socket from argparse import Namespace from unittest.mock import MagicMock, Mock, patch import pytest from ramalama.command.factory import assemble_command from ramalama.common import MNT_DIR from ramalama.config import get_config from ramalama.transports.base import Transport, compute_ports, compute_serving_po...
expected_tag
assert
variable
test/unit/test_transport_base.py
test_extract_model_identifiers
94
null
containers/ramalama
import itertools import json import logging import os import platform import random import re import string import time from contextlib import contextmanager from pathlib import Path from subprocess import STDOUT, CalledProcessError import pytest import yaml from test.conftest import ( skip_if_container, skip...
22
assert
numeric_literal
test/e2e/test_serve.py
test_non_existing_model
261
null
Cranot/roam-code
from __future__ import annotations import json import os import sys from pathlib import Path import pytest from click.testing import CliRunner sys.path.insert(0, str(Path(__file__).parent)) from conftest import ( git_init, index_in_process, ) from roam.commands.cmd_cut import cut def run_cut(runner, projec...
b
assert
variable
tests/test_cut.py
test_cut_boundary_fields
TestCutBoundaries
239
null
Cranot/roam-code
from __future__ import annotations import subprocess import pytest from tests.conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) def _git_commit_as(path, author_name, author_email, message): """Make a git commit with an explicit author identi...
d
assert
variable
tests/test_bus_factor.py
test_json_directories_have_expected_fields
TestBusFactorJSON
264
null
Cranot/roam-code
from __future__ import annotations import sys from pathlib import Path import pytest from click.testing import CliRunner sys.path.insert(0, str(Path(__file__).parent)) from conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) def cli_runner(): ...
0
assert
numeric_literal
tests/test_conventions_cmd.py
test_exits_zero
TestConventionsSmoke
221
null
Cranot/roam-code
from __future__ import annotations import pytest from tests.conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) _MIGRATION_WITH_ISSUES = """\ <?php use Illuminate\\Database\\Migrations\\Migration; use Illuminate\\Database\\Schema\\Blueprint; use I...
bc
assert
variable
tests/test_migration_safety.py
test_json_summary_has_by_confidence
TestMigrationSafetyJSON
239
null
Cranot/roam-code
from __future__ import annotations import json import sys from pathlib import Path import pytest sys.path.insert(0, str(Path(__file__).parent)) from conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) def cli_runner(): from click.testing impor...
h2
assert
variable
tests/test_attest.py
test_content_hash_deterministic
TestContentHash
352
null
Cranot/roam-code
from __future__ import annotations import json import sys from pathlib import Path import pytest sys.path.insert(0, str(Path(__file__).parent)) from conftest import git_commit, git_init, index_in_process, roam from roam.graph.anomaly import ( cusum, forecast, mann_kendall_test, modified_z_score, ...
1
assert
numeric_literal
tests/test_anomaly.py
test_known_anomaly_detected
TestModifiedZScore
48
null
Cranot/roam-code
from __future__ import annotations import json import sys from pathlib import Path from click.testing import CliRunner sys.path.insert(0, str(Path(__file__).parent)) from conftest import git_init, index_in_process def _make_project_with_codeowners(tmp_path, codeowners_content, codeowners_loc=".github"): """Help...
0
assert
numeric_literal
tests/test_codeowners.py
test_no_codeowners_file
TestCodeownersCommand
361
null
Cranot/roam-code
from __future__ import annotations import pytest from click.testing import CliRunner def _make_graph(edges): if not HAS_NX: pytest.skip("networkx not installed") G = nx.DiGraph() for src, tgt in edges: G.add_edge(src, tgt) return G def _linear_graph(): return _make_graph([(1, 2),...
3
assert
numeric_literal
tests/test_context_propagation.py
test_linear_chain_depths
TestCalleeChain
289
null
Cranot/roam-code
from __future__ import annotations import os import pytest from tests.conftest import assert_json_envelope, invoke_cli, parse_json_output def orch_project(project_factory): return project_factory( { "auth/login.py": ("from auth.tokens import create_token\ndef authenticate(u, p): return creat...
n
assert
variable
tests/test_orchestrate.py
test_partition_correct_agent_count
TestPartitionForAgents
70
null
Cranot/roam-code
from __future__ import annotations import importlib.util from pathlib import Path def _load_gate_eval_module(): """Load .github/scripts/gate_eval.py as a Python module.""" root = Path(__file__).resolve().parents[1] script = root / ".github" / "scripts" / "gate_eval.py" spec = importlib.util.spec_from_...
[]
assert
collection
tests/test_ci_gate_eval.py
test_scalar_gate_pass
27
null
Cranot/roam-code
from __future__ import annotations import json import os import pytest from tests.conftest import ( assert_json_envelope, parse_json_output, ) def metrics_project(project_factory): """A project with symbols suitable for metrics analysis.""" return project_factory( { "src/models.p...
s
assert
variable
tests/test_metrics_cmd.py
test_file_json_has_symbol_list
TestMetricsCommandJSON
459
null
Cranot/roam-code
from __future__ import annotations import json from roam.output.formatter import ( abbrev_kind, compact_json_envelope, format_edge_kind, format_signature, format_table, format_table_compact, indent, loc, section, symbol_line, table_to_dicts, to_json, truncate_lines,...
"fn"
assert
string_literal
tests/test_formatters.py
test_function
TestAbbrevKind
29
null
Cranot/roam-code
from __future__ import annotations import pytest from tests.conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) def laravel_project(tmp_path): """Laravel-style PHP project with routes and controllers.""" proj = tmp_path / "laravel_proj" ...
result.output
assert
complex_expr
tests/test_auth_gaps.py
test_verdict_line
TestAuthGapsText
198
null
Cranot/roam-code
from __future__ import annotations import json import sqlite3 from pathlib import Path import networkx as nx import pytest from click.testing import CliRunner from roam.cli import cli def _make_db(tmp_path: Path) -> sqlite3.Connection: db_path = tmp_path / ".roam" / "index.db" db_path.parent.mkdir(parents=T...
7
assert
numeric_literal
tests/test_check_rules.py
test_resolve_rules_disable_multiple
630
null
Cranot/roam-code
from __future__ import annotations import sys from pathlib import Path import pytest from click.testing import CliRunner sys.path.insert(0, str(Path(__file__).parent)) from conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) def cli_runner(): ...
v
assert
variable
tests/test_conventions_cmd.py
test_mixed_naming_violation_fields
TestConventionsNaming
413
null
Cranot/roam-code
from __future__ import annotations import json import os import sys from pathlib import Path import pytest from click.testing import CliRunner sys.path.insert(0, str(Path(__file__).parent)) from conftest import git_init, index_in_process def cli_runner(): return CliRunner() def clean_project(tmp_path): """...
p
assert
variable
tests/test_vibe_check.py
test_json_patterns_array
TestVibeCheckJSON
314
null
Cranot/roam-code
from __future__ import annotations import sqlite3 from unittest.mock import patch import pytest def tmp_db(tmp_path): """Create a minimal in-memory-style SQLite DB with required tables.""" db_path = tmp_path / ".roam" / "index.db" db_path.parent.mkdir(parents=True) conn = sqlite3.connect(str(db_path...
3
assert
numeric_literal
tests/test_batch_mcp.py
test_multiple_queries
TestBatchSearch
426
null
Cranot/roam-code
from __future__ import annotations import sys from pathlib import Path import pytest from click.testing import CliRunner sys.path.insert(0, str(Path(__file__).parent)) from conftest import assert_json_envelope, invoke_cli, parse_json_output from roam.cli import cli def cli_runner(): """Provide a Click CliRunne...
out.lower()
assert
func_call
tests/test_closure.py
test_closure_finds_tests
TestClosure
112
null
Cranot/roam-code
from __future__ import annotations import json import os import subprocess import sys import time from pathlib import Path import click import pytest from click.testing import CliRunner sys.path.insert(0, str(Path(__file__).parent)) from conftest import ( git_init, index_in_process, ) def _make_local_cli():...
1
assert
numeric_literal
tests/test_ai_ratio.py
test_burst_session_detected
TestTemporalSignal
337
null
Cranot/roam-code
from __future__ import annotations import json import sys from pathlib import Path import pytest sys.path.insert(0, str(Path(__file__).parent)) from conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) def cli_runner(): from click.testing impor...
bc
assert
variable
tests/test_attest.py
test_attest_has_breaking_changes
TestAttestEvidence
187
null
Cranot/roam-code
from __future__ import annotations import sys from pathlib import Path import pytest from click.testing import CliRunner sys.path.insert(0, str(Path(__file__).parent)) from conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) def cli_runner(): ...
None
assert
none_literal
tests/test_conventions_cmd.py
test_dunder_returns_none
TestClassifyCase
465
null
Cranot/roam-code
from __future__ import annotations import pytest from tests.conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) def adr_project(tmp_path): proj = tmp_path / "adr_proj" proj.mkdir() (proj / ".gitignore").write_text(".roam/\n") # Sou...
3
assert
numeric_literal
tests/test_adrs.py
test_json_has_adrs_list
TestAdrsJSON
82
null
Cranot/roam-code
from __future__ import annotations import json import sys from pathlib import Path import pytest sys.path.insert(0, str(Path(__file__).parent)) from conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) def cli_runner(): from click.testing impor...
1
assert
numeric_literal
tests/test_attest.py
test_attest_has_blast_radius
TestAttestEvidence
167
null
Cranot/roam-code
from __future__ import annotations import sys from pathlib import Path import pytest from click.testing import CliRunner sys.path.insert(0, str(Path(__file__).parent)) from conftest import ( assert_json_envelope, git_commit, git_init, index_in_process, invoke_cli, parse_json_output, ) def cl...
1
assert
numeric_literal
tests/test_alerts_cmd.py
test_check_thresholds_health_below_60
TestAlertsInternals
302
null
Cranot/roam-code
from __future__ import annotations import json import sys from pathlib import Path import pytest sys.path.insert(0, str(Path(__file__).parent)) from conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) def cli_runner(): from click.testing impor...
br
assert
variable
tests/test_attest.py
test_attest_has_blast_radius
TestAttestEvidence
166
null
Cranot/roam-code
from __future__ import annotations import json import os import subprocess import sys import time from pathlib import Path import click import pytest from click.testing import CliRunner sys.path.insert(0, str(Path(__file__).parent)) from conftest import ( git_init, index_in_process, ) def _make_local_cli():...
3
assert
numeric_literal
tests/test_ai_ratio.py
test_since_flag_long_range
TestAIRatioCommand
513
null
Cranot/roam-code
from __future__ import annotations import pytest from tests.conftest import ( assert_json_envelope, git_init, index_in_process, invoke_cli, parse_json_output, ) def describe_project(tmp_path): """Python project with several files and functions for describe testing.""" proj = tmp_path / "d...
result.output
assert
complex_expr
tests/test_describe.py
test_verdict_line
TestDescribeText
135
null