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
nerfbaselines/nerfbaselines
import pytest import os import sys import contextlib from unittest import mock from nerfbaselines import Method, MethodInfo, ModelInfo import numpy as np def clear_allowed_methods(): allowed_methods = os.environ.get("NERFBASELINES_ALLOWED_METHODS", None) try: os.environ.pop("NERFBASELINES_ALLOWED_METHO...
0
assert
numeric_literal
tests/test_registry.py
test_install_method_spec
416
null
nerfbaselines/nerfbaselines
import sys import importlib import numpy as np import copy import argparse import os import pytest METHOD_NAME = "pgsr" def method_source_code(load_source_code): load_source_code("https://github.com/zju3dv/PGSR.git", "de24f1a38b350387e8d8fe381b2cd70c1ae946e7") def colmap_dataset(colmap_dataset_path): from ne...
splats
assert
variable
tests/methods/test_pgsr.py
_test_method
113
null
nerfbaselines/nerfbaselines
import contextlib import traceback import sys import json import glob import pprint import logging import os import numpy as np import click from PIL import Image import tempfile from tqdm import trange import nerfbaselines from typing import Type import urllib.request from nerfbaselines import ( build_method_class...
getattr(v2, "shape", v2)
assert
func_call
nerfbaselines/cli/_test_method.py
test_render
366
null
nerfbaselines/nerfbaselines
from pathlib import Path import functools from typing import cast import os import gc import contextlib import pytest import numpy as np import sys from unittest import mock import nerfbaselines._registry def _enable_gc(fn): @functools.wraps(fn) def wrapper(*args, **kwargs): out = fn(*args, **kwargs) ...
None
assert
none_literal
tests/methods/_test_multinerf.py
render_image
111
null
nerfbaselines/nerfbaselines
import numpy as np from unittest import mock import pytest from time import sleep, perf_counter from nerfbaselines.utils import Indices from nerfbaselines.utils import CancellationToken, CancelledException def test_indices_last(): indices = Indices([-1]) indices.total = 12 for i in range(12): if i ...
indices
assert
variable
tests/test_utils.py
test_indices_last
14
null
nerfbaselines/nerfbaselines
import sys import contextlib import logging from unittest import mock import math from typing import List, Dict, Any, cast, Union, Type, Iterator, Optional, Tuple import base64 import os import struct from pathlib import Path import json import warnings import numpy as np from .io import open_any from . import ( me...
frozenset(supported_camera_models)
assert
func_call
nerfbaselines/results.py
get_method_info_from_spec
189
null
nerfbaselines/nerfbaselines
import json import sys import pytest from typing import Any, cast from unittest import mock from nerfbaselines import get_supported_methods, get_supported_datasets from nerfbaselines.results import render_markdown_dataset_results_table def mock_results(results_path, datasets, methods): from nerfbaselines import ge...
dataset)
assert_*
variable
tests/test_results.py
test_compile_dataset_results
120
null
nerfbaselines/nerfbaselines
import re import fnmatch import argparse from pathlib import Path import os import sys import importlib import inspect sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "_ext")) project = 'NerfBaselines' copyright = '2024, Jonas Kulhanek' author = 'Jonas Kulhanek' extensions = [ 'sphinx....
"py"
assert
string_literal
docs/conf.py
linkcode_resolve
80
null
nerfbaselines/nerfbaselines
import numpy as np from unittest import mock import pytest from time import sleep, perf_counter from nerfbaselines.utils import Indices from nerfbaselines.utils import CancellationToken, CancelledException def test_cancel_generator(): was_called = False def fn(): nonlocal was_called was_called...
1
assert
numeric_literal
tests/test_utils.py
test_cancel_generator
71
null
nerfbaselines/nerfbaselines
import os from unittest import mock import contextlib import numpy as np import pytest from nerfbaselines import ( get_supported_methods, get_method_spec, ) from nerfbaselines.training import ( get_presets_and_config_overrides, ) from nerfbaselines import build_method_class from nerfbaselines.datasets impor...
"apptainer"
assert
string_literal
tests/test_methods.py
test_method_apptainer
204
null
nerfbaselines/nerfbaselines
import sys import importlib import numpy as np import copy import argparse import os import pytest import matplotlib.colors from nerfbaselines._registry import collect_register_calls METHOD_ID = "dropgaussian" def method_source_code(load_source_code): with collect_register_calls([]): from nerfbaselines.m...
splats
assert
variable
tests/methods/test_dropgaussian.py
_test_method
108
null
nerfbaselines/nerfbaselines
import contextlib import traceback import sys import json import glob import pprint import logging import os import numpy as np import click from PIL import Image import tempfile from tqdm import trange import nerfbaselines from typing import Type import urllib.request from nerfbaselines import ( build_method_class...
len(render2_out)
assert
func_call
nerfbaselines/cli/_test_method.py
test_render
362
null
nerfbaselines/nerfbaselines
import json from pathlib import Path def test_open_any_directory(tmp_path): from nerfbaselines.io import open_any_directory, open_any with open_any_directory(tmp_path / "data.zip/obj.tar.gz/test/test.zip/ok/pass.zip", "w") as _path: path = Path(_path) (path / "data.txt").write_text("Hello worl...
"Hello world2"
assert
string_literal
tests/test_io.py
test_open_any_directory
44
null
nerfbaselines/nerfbaselines
import numpy as np import json import os from unittest import mock import contextlib import pytest def _test_generic_dataset(tmp_path, dataset_name, scene, train_size, test_size): from nerfbaselines.datasets import load_dataset with contextlib.ExitStack() as stack: stack.enter_context(mock.patch("nerf...
2
assert
numeric_literal
tests/test_datasets.py
test_phototourism_evaluation_protocol
251
null
nerfbaselines/nerfbaselines
import sys import importlib import numpy as np import copy import argparse import os import pytest METHOD_NAME = "3dgs-mcmc" def method_source_code(load_source_code): load_source_code("https://github.com/ubc-vision/3dgs-mcmc.git", "a22a24bd7e64b089d983bfcf52c906df7d46f25d") def colmap_dataset(colmap_dataset_path...
render
assert
variable
tests/methods/test_3dgs_mcmc.py
_test_method
89
null
nerfbaselines/nerfbaselines
import os from unittest import mock import contextlib import numpy as np import pytest from nerfbaselines import ( get_supported_methods, get_method_spec, ) from nerfbaselines.training import ( get_presets_and_config_overrides, ) from nerfbaselines import build_method_class from nerfbaselines.datasets impor...
argv[0]
assert
complex_expr
tests/test_methods.py
new_execvpe
172
null
nerfbaselines/nerfbaselines
import sys import contextlib import logging from unittest import mock import math from typing import List, Dict, Any, cast, Union, Type, Iterator, Optional, Tuple import base64 import os import struct from pathlib import Path import json import warnings import numpy as np from .io import open_any from . import ( me...
None
assert
none_literal
nerfbaselines/results.py
_process_data_for_formatting
499
null
nerfbaselines/nerfbaselines
import importlib.resources import sys from typing import cast import numpy as np import pytest from nerfbaselines.metrics import torchmetrics_ssim, dmpix_ssim from nerfbaselines import metrics @pytest.mark.extras @pytest.mark.filterwarnings("ignore::UserWarning:torchvision") @pytest.mark.parametrize("kernel_size", [No...
reference_ssim)
assert_*
variable
tests/test_metrics.py
test_torchmetrics_ssim
46
null
nerfbaselines/nerfbaselines
import pytest import os from functools import partial import threading import pytest import time from time import sleep import gc from unittest import mock from nerfbaselines.utils import CancelledException, CancellationToken from nerfbaselines.backends._common import SimpleBackend from nerfbaselines import backends ...
3
assert
numeric_literal
tests/test_rpc.py
test_rpc_backend_instance
132
null
nerfbaselines/nerfbaselines
import pytest import os import numpy as np from typing import Optional, TypeVar from unittest import mock from unittest.mock import MagicMock from nerfbaselines import Method, new_cameras from nerfbaselines import evaluation from PIL import Image import tarfile import zipfile T = TypeVar("T") def _assert_not_none(val...
None
assert
none_literal
tests/test_render_frames.py
_assert_not_none
22
null
nerfbaselines/nerfbaselines
import sys import importlib import numpy as np import copy import argparse import os import pytest import matplotlib.colors from nerfbaselines._registry import collect_register_calls METHOD_ID = "dropgaussian" def method_source_code(load_source_code): with collect_register_calls([]): from nerfbaselines.m...
render
assert
variable
tests/methods/test_dropgaussian.py
_test_method
93
null
nerfbaselines/nerfbaselines
_patch = """diff --git a/scene/__init__.py b/scene/__init__.py index 2b31398..c31679a 100644 --- a/scene/__init__.py +++ b/scene/__init__.py @@ -25 +25 @@ class Scene: - def __init__(self, args : ModelParams, gaussians : GaussianModel, load_iteration=None, shuffle=True, resolution_scales=[1.0]): + def __init__(se...
None
assert
none_literal
tests/test_patching.py
test_parse_patch
34
null
nerfbaselines/nerfbaselines
from unittest import mock import importlib import numpy as np import copy import argparse import os import pytest from PIL import Image import matplotlib.pyplot from nerfbaselines._registry import collect_register_calls METHOD_ID = "sparsegs" def method_source_code(load_source_code): with collect_register_calls(...
splats
assert
variable
tests/methods/test_sparsegs.py
_test_method
150
null
nerfbaselines/nerfbaselines
from contextlib import nullcontext import shutil import subprocess import importlib import gc import copy import tarfile import json import sys import pickle from functools import partial import inspect from unittest import mock import contextlib import os import pytest from pathlib import Path import numpy as np from ...
render_old)
assert_*
variable
tests/conftest.py
run_test_train
272
null
nerfbaselines/nerfbaselines
import pytest import os import sys import contextlib from unittest import mock from nerfbaselines import Method, MethodInfo, ModelInfo import numpy as np def clear_allowed_methods(): allowed_methods = os.environ.get("NERFBASELINES_ALLOWED_METHODS", None) try: os.environ.pop("NERFBASELINES_ALLOWED_METHO...
None
assert
none_literal
tests/test_registry.py
test_register_environment_variable_does_not_override_default
340
null
nerfbaselines/nerfbaselines
import sys from unittest import mock import pytest import os import json import numpy as np from pathlib import Path import tarfile from PIL import Image from nerfbaselines.evaluation import evaluate def _generate_predictions(path, background_color=None): path = Path(path) for i in range(100): (path /...
0
assert
numeric_literal
tests/test_evaluate.py
test_evaluate_command_extras
79
null
nerfbaselines/nerfbaselines
import pytest import os import sys import contextlib from unittest import mock from nerfbaselines import Method, MethodInfo, ModelInfo import numpy as np def clear_allowed_methods(): allowed_methods = os.environ.get("NERFBASELINES_ALLOWED_METHODS", None) try: os.environ.pop("NERFBASELINES_ALLOWED_METHO...
(23, 30)
assert
collection
tests/test_registry.py
test_method_autocast_render
254
null
nerfbaselines/nerfbaselines
_patch = """diff --git a/scene/__init__.py b/scene/__init__.py index 2b31398..c31679a 100644 --- a/scene/__init__.py +++ b/scene/__init__.py @@ -25 +25 @@ class Scene: - def __init__(self, args : ModelParams, gaussians : GaussianModel, load_iteration=None, shuffle=True, resolution_scales=[1.0]): + def __init__(se...
p
assert
variable
tests/test_patching.py
test_apply_patch
63
null
nerfbaselines/nerfbaselines
from functools import partial from unittest import mock import contextlib import pytest from typing import Iterable import numpy as np from time import sleep from nerfbaselines import Method, MethodInfo, RenderOutput, ModelInfo, new_cameras from nerfbaselines.utils import CancellationToken, CancelledException def use_...
f'{compute_metrics.__module__}:{compute_metrics.__name__}'
assert
string_literal
tests/test_communication.py
intercept
128
null
nerfbaselines/nerfbaselines
import pytest import os import sys import contextlib from unittest import mock from nerfbaselines import Method, MethodInfo, ModelInfo import numpy as np def clear_allowed_methods(): allowed_methods = os.environ.get("NERFBASELINES_ALLOWED_METHODS", None) try: os.environ.pop("NERFBASELINES_ALLOWED_METHO...
set(("p1",))
assert
func_call
tests/test_registry.py
test_get_presets_to_apply
142
null
nerfbaselines/nerfbaselines
import os import pytest from nerfbaselines import get_supported_methods, get_method_spec @pytest.mark.parametrize("method_name", [pytest.param(k, marks=[pytest.mark.method(k)]) for k in get_supported_methods("docker")]) def test_docker_get_dockerfile(method_name): from nerfbaselines.backends._docker import docker_...
None
assert
none_literal
tests/test_backends.py
test_docker_get_dockerfile
11
null
nerfbaselines/nerfbaselines
import numpy as np from unittest import mock import pytest from time import sleep, perf_counter from nerfbaselines.utils import Indices from nerfbaselines.utils import CancellationToken, CancelledException @click.command() @click.option("--val", type=TupleClickType(), default=()) def cmd(val): ...
()
assert
collection
tests/test_utils.py
cmd
100
null
nerfbaselines/nerfbaselines
import contextlib import traceback import sys import json import glob import pprint import logging import os import numpy as np import click from PIL import Image import tempfile from tqdm import trange import nerfbaselines from typing import Type import urllib.request from nerfbaselines import ( build_method_class...
v2)
assert_*
variable
nerfbaselines/cli/_test_method.py
test_render
369
null
nerfbaselines/nerfbaselines
import pytest import os import sys import contextlib from unittest import mock from nerfbaselines import Method, MethodInfo, ModelInfo import numpy as np def clear_allowed_methods(): allowed_methods = os.environ.get("NERFBASELINES_ALLOWED_METHODS", None) try: os.environ.pop("NERFBASELINES_ALLOWED_METHO...
SystemExit)
pytest.raises
variable
tests/test_registry.py
test_install_method_spec
413
null
nerfbaselines/nerfbaselines
import numpy as np import json import os from unittest import mock import contextlib import pytest def _test_generic_dataset(tmp_path, dataset_name, scene, train_size, test_size): from nerfbaselines.datasets import load_dataset with contextlib.ExitStack() as stack: stack.enter_context(mock.patch("nerf...
None
assert
none_literal
tests/test_datasets.py
test_phototourism_evaluation_protocol
255
null
nerfbaselines/nerfbaselines
import numpy as np from unittest import mock import pytest from time import sleep, perf_counter from nerfbaselines.utils import Indices from nerfbaselines.utils import CancellationToken, CancelledException def test_tuple_click_type(): import click from nerfbaselines.cli._common import TupleClickType with ...
0
assert
numeric_literal
tests/test_utils.py
test_tuple_click_type
93
null
nerfbaselines/nerfbaselines
import sys import contextlib import logging from unittest import mock import math from typing import List, Dict, Any, cast, Union, Type, Iterator, Optional, Tuple import base64 import os import struct from pathlib import Path import json import warnings import numpy as np from .io import open_any from . import ( me...
frozenset(required_features)
assert
func_call
nerfbaselines/results.py
get_method_info_from_spec
191
null
nerfbaselines/nerfbaselines
import sys import importlib import numpy as np import copy import argparse import os import pytest METHOD_NAME = "student-splatting-scooping" def method_source_code(load_source_code): load_source_code("https://github.com/realcrane/3D-student-splating-and-scooping.git", "bf6d26f0aa54663d9084c24d6121eab7705b9fdd") ...
render
assert
variable
tests/methods/test_student_splatting_scooping.py
_test_method
95
null
nerfbaselines/nerfbaselines
import sys import importlib import numpy as np import copy import argparse import os import pytest METHOD_NAME = "3dgs-mcmc" def method_source_code(load_source_code): load_source_code("https://github.com/ubc-vision/3dgs-mcmc.git", "a22a24bd7e64b089d983bfcf52c906df7d46f25d") def colmap_dataset(colmap_dataset_path...
splats
assert
variable
tests/methods/test_3dgs_mcmc.py
_test_method
104
null
nerfbaselines/nerfbaselines
import json import sys import pytest from typing import Any, cast from unittest import mock from nerfbaselines import get_supported_methods, get_supported_datasets from nerfbaselines.results import render_markdown_dataset_results_table def mock_results(results_path, datasets, methods): from nerfbaselines import ge...
v)
assert_*
variable
tests/test_results.py
assert_ok_type
105
null
nerfbaselines/nerfbaselines
import sys import importlib import numpy as np import copy import argparse import os import pytest METHOD_NAME = "pgsr" def method_source_code(load_source_code): load_source_code("https://github.com/zju3dv/PGSR.git", "de24f1a38b350387e8d8fe381b2cd70c1ae946e7") def colmap_dataset(colmap_dataset_path): from ne...
render
assert
variable
tests/methods/test_pgsr.py
_test_method
98
null
nerfbaselines/nerfbaselines
from contextlib import nullcontext import shutil import subprocess import importlib import gc import copy import tarfile import json import sys import pickle from functools import partial import inspect from unittest import mock import contextlib import os import pytest from pathlib import Path import numpy as np from ...
None
assert
none_literal
tests/conftest.py
run_test_train
254
null
nerfbaselines/nerfbaselines
from unittest.mock import patch import sys import importlib import numpy as np import copy import argparse import os import pytest from nerfbaselines._registry import collect_register_calls METHOD_ID = "3dgrut" def method_source_code(load_source_code, mock_module): sys.modules.pop('fused_ssim', None) mock_mo...
render
assert
variable
tests/methods/test_threedgrut.py
_test_method
118
null
nerfbaselines/nerfbaselines
import contextlib import sys import shutil import json from typing import cast from pathlib import Path import os import numpy as np from nerfbaselines import Method, MethodInfo, Cameras, RenderOutput, ModelInfo from nerfbaselines.utils import Indices from nerfbaselines.datasets import _colmap_utils as colmap_utils fro...
12
assert
numeric_literal
tests/test_train_render.py
test_train_command
160
null
nerfbaselines/nerfbaselines
import pytest import os import numpy as np from typing import Optional, TypeVar from unittest import mock from unittest.mock import MagicMock from nerfbaselines import Method, new_cameras from nerfbaselines import evaluation from PIL import Image import tarfile import zipfile T = TypeVar("T") def _assert_not_none(val...
0
assert
numeric_literal
tests/test_render_frames.py
_test_render_trajectory_command
108
null
Chen-zexi/vllm-cli
from unittest.mock import patch import pytest from vllm_cli.models.cache import ModelCache from vllm_cli.models.manager import ModelManager class TestOllamaWorkflow: def test_full_ollama_workflow(self): """Test complete workflow from discovery to listing.""" from vllm_cli.models.discovery import...
"ollama/phi3:mini"
assert
string_literal
tests/test_ollama_integration_fixed.py
test_full_ollama_workflow
TestOllamaWorkflow
314
null
Chen-zexi/vllm-cli
import tempfile from pathlib import Path from unittest.mock import MagicMock, patch import pytest import yaml from vllm_cli.proxy.config import ProxyConfigManager from vllm_cli.proxy.manager import ProxyManager from vllm_cli.proxy.models import ModelConfig, ProxyConfig from vllm_cli.proxy.server_process import ProxyS...
"1"
assert
string_literal
tests/proxy/test_integration.py
test_gpu_assignment_integration
TestProxyIntegration
285
null
Chen-zexi/vllm-cli
import asyncio import socket import threading import time from typing import Any, Dict, Optional from unittest.mock import MagicMock, patch import httpx import pytest from fastapi import FastAPI from fastapi.responses import JSONResponse, StreamingResponse from vllm_cli.proxy.manager import ProxyManager from vllm_cli...
0
assert
numeric_literal
tests/proxy/test_e2e.py
test_e2e_full_model_lifecycle_with_registry
TestProxyE2E
467
null
Chen-zexi/vllm-cli
from unittest.mock import patch import pytest from vllm_cli.models.cache import ModelCache from vllm_cli.models.manager import ModelManager class TestOllamaCacheTTL: def test_cache_stats_tracking(self): """Test that cache statistics are properly tracked internally.""" cache = ModelCache() ...
initial_stats["hits"]
assert
complex_expr
tests/test_ollama_integration_fixed.py
test_cache_stats_tracking
TestOllamaCacheTTL
148
null
Chen-zexi/vllm-cli
import pytest from pydantic import ValidationError from vllm_cli.proxy.models import ModelConfig, ModelStatus, ProxyConfig, ProxyStatus class TestModelConfig: def test_model_config_defaults(self): """Test ModelConfig with default values.""" config = ModelConfig( name="minimal", ...
{}
assert
collection
tests/proxy/test_models.py
test_model_config_defaults
TestModelConfig
44
null
Chen-zexi/vllm-cli
from unittest.mock import AsyncMock, MagicMock, patch import pytest from fastapi.testclient import TestClient from vllm_cli.proxy.models import ProxyConfig from vllm_cli.proxy.registry import ( ModelEntry, ModelRegistry, ModelState, RegistrationStatus, ) from vllm_cli.proxy.server import ProxyServer ...
1
assert
numeric_literal
tests/proxy/test_server.py
test_proxy_status_endpoint
TestProxyServer
169
null
Chen-zexi/vllm-cli
from unittest.mock import MagicMock, patch import pytest from vllm_cli.models.discovery import build_model_dict from vllm_cli.models.manager import ModelManager class TestOllamaDiscovery: @patch("vllm_cli.models.discovery.scan_for_models") def test_scan_includes_ollama_models(self, mock_scan): """Te...
1
assert
numeric_literal
tests/test_ollama_support.py
test_scan_includes_ollama_models
TestOllamaDiscovery
62
null
Chen-zexi/vllm-cli
import pytest from vllm_cli.proxy.router import RequestRouter class TestRequestRouter: def router(self): """Create a RequestRouter instance.""" return RequestRouter() def test_route_request_no_match(self, router): """Test routing when no backend matches.""" router.add_backend...
None
assert
none_literal
tests/proxy/test_router.py
test_route_request_no_match
TestRequestRouter
66
null
Chen-zexi/vllm-cli
import pytest from vllm_cli.cli.parser import create_parser class TestCLIParser: def test_serve_with_shortcut(self): """Test serve command with shortcut option.""" parser = create_parser() # Test with shortcut only (no model needed) args = parser.parse_args(["serve", "--shortcut"...
"gpt2"
assert
string_literal
tests/test_cli_parser.py
test_serve_with_shortcut
TestCLIParser
162
null
Chen-zexi/vllm-cli
import tempfile from pathlib import Path from unittest.mock import MagicMock, patch import pytest import yaml from vllm_cli.proxy.config import ProxyConfigManager from vllm_cli.proxy.manager import ProxyManager from vllm_cli.proxy.models import ModelConfig, ProxyConfig from vllm_cli.proxy.server_process import ProxyS...
"0"
assert
string_literal
tests/proxy/test_integration.py
test_gpu_assignment_integration
TestProxyIntegration
280
null
Chen-zexi/vllm-cli
from unittest.mock import patch import pytest from vllm_cli.models.cache import ModelCache from vllm_cli.models.manager import ModelManager class TestOllamaCacheTTL: def test_cache_ttl_bypass_on_refresh(self): """Test that TTL is bypassed when refresh=True.""" cache = ModelCache(ttl_seconds=3600...
new_models
assert
variable
tests/test_ollama_integration_fixed.py
test_cache_ttl_bypass_on_refresh
TestOllamaCacheTTL
106
null
Chen-zexi/vllm-cli
import pytest from pydantic import ValidationError from vllm_cli.proxy.models import ModelConfig, ModelStatus, ProxyConfig, ProxyStatus class TestModelStatus: def test_model_status_creation(self): """Test creating a ModelStatus.""" status = ModelStatus( name="test-model", ...
100
assert
numeric_literal
tests/proxy/test_models.py
test_model_status_creation
TestModelStatus
188
null
Chen-zexi/vllm-cli
from unittest.mock import patch import pytest from vllm_cli.models.cache import ModelCache from vllm_cli.models.manager import ModelManager class TestOllamaWorkflow: def test_full_ollama_workflow(self): """Test complete workflow from discovery to listing.""" from vllm_cli.models.discovery import...
"ollama_model"
assert
string_literal
tests/test_ollama_integration_fixed.py
test_full_ollama_workflow
TestOllamaWorkflow
315
null
Chen-zexi/vllm-cli
import pytest from pydantic import ValidationError from vllm_cli.proxy.models import ModelConfig, ModelStatus, ProxyConfig, ProxyStatus class TestModelConfig: def test_model_config_serialization(self): """Test ModelConfig serialization.""" config = ModelConfig( name="test", ...
[0]
assert
collection
tests/proxy/test_models.py
test_model_config_serialization
TestModelConfig
81
null
Chen-zexi/vllm-cli
from unittest.mock import MagicMock, patch import pytest from vllm_cli.models.discovery import build_model_dict from vllm_cli.models.manager import ModelManager class TestOllamaModelMetadata: def test_ollama_model_dict_structure(self): """Test the structure of Ollama model dictionary.""" ollama_...
ollama_model
assert
variable
tests/test_ollama_support.py
test_ollama_model_dict_structure
TestOllamaModelMetadata
372
null
Chen-zexi/vllm-cli
from unittest.mock import Mock, patch import yaml from vllm_cli.config.manager import ConfigManager class TestConfigManager: @patch("vllm_cli.config.manager.Path.home") def test_get_last_config(self, mock_home, temp_config_dir): """Test getting last used configuration.""" mock_home.return_va...
"llama-7b"
assert
string_literal
tests/test_config_manager.py
test_get_last_config
TestConfigManager
102
null
Chen-zexi/vllm-cli
from unittest.mock import Mock, patch import yaml from vllm_cli.config.manager import ConfigManager class TestConfigManager: @patch("vllm_cli.config.manager.Path.home") def test_save_config(self, mock_home, temp_config_dir): """Test saving configuration.""" mock_home.return_value = temp_conf...
"test_value"
assert
string_literal
tests/test_config_manager.py
test_save_config
TestConfigManager
76
null
Chen-zexi/vllm-cli
import pytest from pydantic import ValidationError from vllm_cli.proxy.models import ModelConfig, ModelStatus, ProxyConfig, ProxyStatus class TestModelConfig: def test_model_config_defaults(self): """Test ModelConfig with default values.""" config = ModelConfig( name="minimal", ...
None
assert
none_literal
tests/proxy/test_models.py
test_model_config_defaults
TestModelConfig
43
null
Chen-zexi/vllm-cli
from datetime import datetime from unittest.mock import Mock, patch import pytest from vllm_cli.server import process from vllm_cli.server.manager import VLLMServer def clean_active_servers(): """Ensure _active_servers is clean before and after each test.""" # Save original state original = process._acti...
command_str
assert
variable
tests/test_server_manager.py
test_build_command
TestVLLMServer
48
null
Chen-zexi/vllm-cli
import tempfile from pathlib import Path from unittest.mock import MagicMock, patch import pytest import yaml from vllm_cli.proxy.config import ProxyConfigManager from vllm_cli.proxy.manager import ProxyManager from vllm_cli.proxy.models import ModelConfig, ProxyConfig from vllm_cli.proxy.server_process import ProxyS...
1
assert
numeric_literal
tests/proxy/test_integration.py
test_proxy_manager_full_lifecycle
TestProxyIntegration
119
null
Chen-zexi/vllm-cli
import pytest from pydantic import ValidationError from vllm_cli.proxy.models import ModelConfig, ModelStatus, ProxyConfig, ProxyStatus class TestProxyConfig: def test_proxy_config_serialization(self): """Test ProxyConfig serialization.""" model = ModelConfig( name="test", ...
1
assert
numeric_literal
tests/proxy/test_models.py
test_proxy_config_serialization
TestProxyConfig
162
null
Chen-zexi/vllm-cli
import pytest from pydantic import ValidationError from vllm_cli.proxy.models import ModelConfig, ModelStatus, ProxyConfig, ProxyStatus class TestModelConfig: def test_model_config_creation(self): """Test creating a valid ModelConfig.""" config = ModelConfig( name="test-model", ...
True
assert
bool_literal
tests/proxy/test_models.py
test_model_config_creation
TestModelConfig
32
null
Chen-zexi/vllm-cli
from datetime import datetime from unittest.mock import Mock, patch import pytest from vllm_cli.server import process from vllm_cli.server.manager import VLLMServer def clean_active_servers(): """Ensure _active_servers is clean before and after each test.""" # Save original state original = process._acti...
status
assert
variable
tests/test_server_manager.py
test_get_status
TestVLLMServer
172
null
Chen-zexi/vllm-cli
import json import shutil import tempfile from pathlib import Path from unittest.mock import MagicMock, patch import pytest from vllm_cli.models.manager import ModelManager from vllm_cli.models.manifest import apply_manifest_to_models, load_manifest class TestCustomDirectoryIntegration: def temp_custom_dir(self...
"local"
assert
string_literal
tests/test_custom_directory_integration.py
test_custom_model_selection
TestCustomDirectoryIntegration
233
null
Chen-zexi/vllm-cli
import pytest from pydantic import ValidationError from vllm_cli.proxy.models import ModelConfig, ModelStatus, ProxyConfig, ProxyStatus class TestProxyConfig: def test_proxy_config_with_empty_models(self): """Test ProxyConfig with no models.""" config = ProxyConfig( host="localhost", ...
0
assert
numeric_literal
tests/proxy/test_models.py
test_proxy_config_with_empty_models
TestProxyConfig
144
null
Chen-zexi/vllm-cli
import json from pathlib import Path from unittest.mock import patch from vllm_cli.config.profiles import ProfileManager class TestProfileManager: def test_load_user_profiles_no_file(self, temp_config_dir): """Test loading user profiles when file doesn't exist.""" manager = ProfileManager(temp_co...
{}
assert
collection
tests/test_profiles.py
test_load_user_profiles_no_file
TestProfileManager
41
null
Chen-zexi/vllm-cli
from unittest.mock import MagicMock, patch import pytest from vllm_cli.models.discovery import build_model_dict from vllm_cli.models.manager import ModelManager class TestOllamaModelSelection: def test_select_ollama_model_format(self): """Test Ollama model selection returns correct format for serving.""...
"qwen3:30b"
assert
string_literal
tests/test_ollama_support.py
test_select_ollama_model_format
TestOllamaModelSelection
135
null
Chen-zexi/vllm-cli
from vllm_cli.validation.base import ValidationError, ValidationResult from vllm_cli.validation.registry import ValidationRegistry from vllm_cli.validation.types import ( BooleanValidator, ChoiceValidator, FloatValidator, IntegerValidator, StringValidator, ) class TestValidationBasics: def tes...
True
assert
bool_literal
tests/test_validation_simple.py
test_validation_result
TestValidationBasics
20
null
Chen-zexi/vllm-cli
import json import shutil import tempfile from pathlib import Path from unittest.mock import MagicMock, patch import pytest from vllm_cli.models.manager import ModelManager from vllm_cli.models.manifest import apply_manifest_to_models, load_manifest class TestCustomDirectoryIntegration: def temp_custom_dir(self...
1
assert
numeric_literal
tests/test_custom_directory_integration.py
test_end_to_end_custom_model_serving
TestCustomDirectoryIntegration
270
null
Chen-zexi/vllm-cli
import pytest from pydantic import ValidationError from vllm_cli.proxy.models import ModelConfig, ModelStatus, ProxyConfig, ProxyStatus class TestModelConfig: def test_model_config_defaults(self): """Test ModelConfig with default values.""" config = ModelConfig( name="minimal", ...
[]
assert
collection
tests/proxy/test_models.py
test_model_config_defaults
TestModelConfig
42
null
Chen-zexi/vllm-cli
import pytest from pydantic import ValidationError from vllm_cli.proxy.models import ModelConfig, ModelStatus, ProxyConfig, ProxyStatus class TestProxyStatus: def test_proxy_status_creation(self): """Test creating a ProxyStatus.""" model_status = ModelStatus( name="model1", ...
500
assert
numeric_literal
tests/proxy/test_models.py
test_proxy_status_creation
TestProxyStatus
250
null
Chen-zexi/vllm-cli
from unittest.mock import AsyncMock, MagicMock, patch import pytest from fastapi.testclient import TestClient from vllm_cli.proxy.models import ProxyConfig from vllm_cli.proxy.registry import ( ModelEntry, ModelRegistry, ModelState, RegistrationStatus, ) from vllm_cli.proxy.server import ProxyServer ...
3
assert
numeric_literal
tests/proxy/test_server.py
test_get_status_summary
TestModelRegistry
501
null
Chen-zexi/vllm-cli
from unittest.mock import patch import pytest from vllm_cli.models.cache import ModelCache from vllm_cli.models.manager import ModelManager class TestOllamaErrorHandling: def test_missing_directories_handling(self): """Test handling of missing Ollama directories.""" manager = ModelManager() ...
[]
assert
collection
tests/test_ollama_integration_fixed.py
test_missing_directories_handling
TestOllamaErrorHandling
228
null
Chen-zexi/vllm-cli
from unittest.mock import Mock, patch import yaml from vllm_cli.config.manager import ConfigManager class TestConfigManager: @patch("vllm_cli.config.manager.Path.home") def test_load_existing_config(self, mock_home, temp_config_dir): """Test loading existing configuration file.""" mock_home....
"test-model"
assert
string_literal
tests/test_config_manager.py
test_load_existing_config
TestConfigManager
57
null
Chen-zexi/vllm-cli
import pytest from vllm_cli.proxy.router import RequestRouter class TestRequestRouter: def router(self): """Create a RequestRouter instance.""" return RequestRouter() def test_wildcard_backend(self, router): """Test wildcard/default backend routing.""" router.add_backend("mod...
"http://localhost:9999"
assert
string_literal
tests/proxy/test_router.py
test_wildcard_backend
TestRequestRouter
77
null
Chen-zexi/vllm-cli
import pytest from vllm_cli.cli.parser import create_parser class TestCLIParser: def test_serve_command_basic(self): """Test basic serve command.""" parser = create_parser() args = parser.parse_args(["serve", "meta-llama/Llama-2-7b"]) assert args.command ==
"serve"
assert
string_literal
tests/test_cli_parser.py
test_serve_command_basic
TestCLIParser
28
null
Chen-zexi/vllm-cli
import json import shutil import tempfile from pathlib import Path from unittest.mock import MagicMock, patch import pytest from vllm_cli.models.manager import ModelManager from vllm_cli.models.manifest import apply_manifest_to_models, load_manifest class TestCustomDirectoryIntegration: def temp_custom_dir(self...
True
assert
bool_literal
tests/test_custom_directory_integration.py
test_add_custom_directory
TestCustomDirectoryIntegration
139
null
Chen-zexi/vllm-cli
from unittest.mock import Mock, patch import yaml from vllm_cli.config.manager import ConfigManager class TestConfigManager: @patch("vllm_cli.config.manager.Path.home") def test_init_creates_config_dir(self, mock_home, temp_config_dir): """Test that ConfigManager creates config directory on init."""...
expected_dir
assert
variable
tests/test_config_manager.py
test_init_creates_config_dir
TestConfigManager
22
null
Chen-zexi/vllm-cli
from unittest.mock import Mock, patch import yaml from vllm_cli.config.manager import ConfigManager class TestConfigManager: @patch("vllm_cli.config.manager.Path.home") def test_validate_config_invalid(self, mock_home, temp_config_dir): """Test validating an invalid configuration.""" mock_ho...
1
assert
numeric_literal
tests/test_config_manager.py
test_validate_config_invalid
TestConfigManager
176
null
Chen-zexi/vllm-cli
import pytest from vllm_cli.proxy.router import RequestRouter class TestRequestRouter: def router(self): """Create a RequestRouter instance.""" return RequestRouter() def test_get_backends(self, router): """Test getting all backend configurations.""" config1 = {"port": 8001, ...
2
assert
numeric_literal
tests/proxy/test_router.py
test_get_backends
TestRequestRouter
99
null
Chen-zexi/vllm-cli
from vllm_cli.validation.base import ValidationError, ValidationResult from vllm_cli.validation.registry import ValidationRegistry from vllm_cli.validation.types import ( BooleanValidator, ChoiceValidator, FloatValidator, IntegerValidator, StringValidator, ) class TestValidationBasics: def tes...
False
assert
bool_literal
tests/test_validation_simple.py
test_validation_result
TestValidationBasics
24
null
Chen-zexi/vllm-cli
import pytest from vllm_cli.cli.parser import create_parser class TestCLIParser: def test_models_command_with_details(self): """Test models command with details flag.""" parser = create_parser() args = parser.parse_args(["models", "--details"]) assert args.command == "models" ...
True
assert
bool_literal
tests/test_cli_parser.py
test_models_command_with_details
TestCLIParser
98
null
Chen-zexi/vllm-cli
import json from pathlib import Path from unittest.mock import patch from vllm_cli.config.profiles import ProfileManager class TestProfileManager: def test_update_existing_profile(self, temp_config_dir): """Test updating an existing user profile.""" manager = ProfileManager(temp_config_dir) ...
updated_data
assert
variable
tests/test_profiles.py
test_update_existing_profile
TestProfileManager
87
null
Chen-zexi/vllm-cli
from unittest.mock import MagicMock, patch import pytest from vllm_cli.models.discovery import build_model_dict from vllm_cli.models.manager import ModelManager class TestOllamaDiscovery: def test_build_model_dict_with_ollama(self): """Test building model dict for Ollama models.""" ollama_item =...
"ollama_model"
assert
string_literal
tests/test_ollama_support.py
test_build_model_dict_with_ollama
TestOllamaDiscovery
31
null
Chen-zexi/vllm-cli
import time from vllm_cli.models.cache import ModelCache from vllm_cli.models.manager import ModelManager class TestModelManager: def test_init(self): """Test ModelManager initialization.""" manager = ModelManager() assert manager.cache is not
None
assert
none_literal
tests/test_model_manager.py
test_init
TestModelManager
15
null
Chen-zexi/vllm-cli
import pytest from vllm_cli.cli.parser import create_parser class TestCLIParser: def test_info_command(self): """Test info command.""" parser = create_parser() args = parser.parse_args(["info"]) assert args.command ==
"info"
assert
string_literal
tests/test_cli_parser.py
test_info_command
TestCLIParser
83
null
Chen-zexi/vllm-cli
import tempfile from pathlib import Path from unittest.mock import MagicMock, patch import pytest import yaml from vllm_cli.proxy.config import ProxyConfigManager from vllm_cli.proxy.manager import ProxyManager from vllm_cli.proxy.models import ModelConfig, ProxyConfig from vllm_cli.proxy.server_process import ProxyS...
2
assert
numeric_literal
tests/proxy/test_integration.py
test_load_proxy_config
TestProxyIntegration
77
null
Chen-zexi/vllm-cli
from datetime import datetime from unittest.mock import Mock, patch import pytest from vllm_cli.server import process from vllm_cli.server.manager import VLLMServer def clean_active_servers(): """Ensure _active_servers is clean before and after each test.""" # Save original state original = process._acti...
logs[1]
assert
complex_expr
tests/test_server_manager.py
test_get_recent_logs
TestVLLMServer
153
null
Chen-zexi/vllm-cli
from datetime import datetime from unittest.mock import Mock, patch import pytest from vllm_cli.server import process from vllm_cli.server.manager import VLLMServer def clean_active_servers(): """Ensure _active_servers is clean before and after each test.""" # Save original state original = process._acti...
logs[0]
assert
complex_expr
tests/test_server_manager.py
test_get_recent_logs
TestVLLMServer
152
null
Chen-zexi/vllm-cli
from datetime import datetime from unittest.mock import Mock, patch import pytest from vllm_cli.server import process from vllm_cli.server.manager import VLLMServer def clean_active_servers(): """Ensure _active_servers is clean before and after each test.""" # Save original state original = process._acti...
12345
assert
numeric_literal
tests/test_server_manager.py
test_get_status
TestVLLMServer
169
null
Chen-zexi/vllm-cli
import pytest from vllm_cli.proxy.router import RequestRouter class TestRequestRouter: def router(self): """Create a RequestRouter instance.""" return RequestRouter() def test_add_backend(self, router): """Test adding a backend.""" router.add_backend( "model1", ...
"http://localhost:8001"
assert
string_literal
tests/proxy/test_router.py
test_add_backend
TestRequestRouter
27
null
Chen-zexi/vllm-cli
from unittest.mock import Mock, patch import yaml from vllm_cli.config.manager import ConfigManager class TestConfigManager: @patch("vllm_cli.config.manager.Path.home") def test_validate_config_valid(self, mock_home, temp_config_dir): """Test validating a valid configuration.""" mock_home.re...
0
assert
numeric_literal
tests/test_config_manager.py
test_validate_config_valid
TestConfigManager
153
null
Chen-zexi/vllm-cli
import json from pathlib import Path from unittest.mock import patch from vllm_cli.config.profiles import ProfileManager class TestProfileManager: def test_save_user_profile(self, temp_config_dir): """Test saving a new user profile.""" manager = ProfileManager(temp_config_dir) profile_da...
profile_data
assert
variable
tests/test_profiles.py
test_save_user_profile
TestProfileManager
72
null
Chen-zexi/vllm-cli
from unittest.mock import Mock, patch import yaml from vllm_cli.config.manager import ConfigManager class TestConfigManager: @patch("vllm_cli.config.manager.Path.home") def test_save_last_config(self, mock_home, temp_config_dir): """Test saving last used configuration.""" mock_home.return_va...
"new-model"
assert
string_literal
tests/test_config_manager.py
test_save_last_config
TestConfigManager
131
null
Chen-zexi/vllm-cli
import pytest from vllm_cli.cli.parser import create_parser class TestCLIParser: def test_create_parser(self): """Test parser creation.""" parser = create_parser() assert parser is not
None
assert
none_literal
tests/test_cli_parser.py
test_create_parser
TestCLIParser
14
null