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 |
|---|---|---|---|---|---|---|---|---|---|
gabrieldemarmiesse/python-on-whales | import json
from contextlib import contextmanager
from pathlib import Path
from typing import Iterator, Sequence, Tuple
import pytest
from python_on_whales import DockerClient, docker
from python_on_whales.client_config import ClientConfig, ParsingError
from python_on_whales.utils import PROJECT_ROOT
fake_json_messa... | ParsingError) | pytest.raises | variable | tests/python_on_whales/test_client_config.py | test_pretty_exception_message_and_report | 28 | null | |
gabrieldemarmiesse/python-on-whales | import time
from pathlib import Path
from typing import Generator
import pytest
from python_on_whales import DockerClient
from python_on_whales.components.stack.cli_wrapper import Stack
from python_on_whales.exceptions import NotASwarmManager
from python_on_whales.utils import PROJECT_ROOT
def stack(
docker_clie... | 4 | assert | numeric_literal | tests/python_on_whales/components/test_stack.py | test_services_inspect | 31 | null | |
gabrieldemarmiesse/python-on-whales | import time
from pathlib import Path
from typing import Generator
import pytest
from python_on_whales import DockerClient
from python_on_whales.components.stack.cli_wrapper import Stack
from python_on_whales.exceptions import NotASwarmManager
from python_on_whales.utils import PROJECT_ROOT
def stack(
docker_clie... | str(e.value).lower() | assert | func_call | tests/python_on_whales/components/test_stack.py | test_deploy_not_swarm_manager | 100 | null | |
gabrieldemarmiesse/python-on-whales | import json
import pytest
from python_on_whales import DockerClient
from python_on_whales.components.context.models import ContextInspectResult
from python_on_whales.test_utils import get_all_jsons
def test_inpect(docker_client: DockerClient):
default_context = docker_client.context.inspect()
assert default_... | docker_client.context.inspect("default") | assert | func_call | tests/python_on_whales/components/test_context.py | test_inpect | 38 | null | |
gabrieldemarmiesse/python-on-whales | import json
import os
import signal
import sys
import tempfile
import time
from datetime import datetime, timedelta, timezone
from pathlib import Path
from typing import Literal, Union
from unittest.mock import Mock, patch
import pytest
import python_on_whales
from python_on_whales import DockerClient, Image, docker
... | 1 | assert | numeric_literal | tests/python_on_whales/components/test_container.py | test_prune_streaming | 1,057 | null | |
gabrieldemarmiesse/python-on-whales | from datetime import timedelta
import pytest
from python_on_whales import DockerClient
from python_on_whales.exceptions import NotASwarmManager
@pytest.mark.usefixtures("swarm_mode")
def test_swarm_unlock_key(docker_client: DockerClient):
docker_client.swarm.update(autolock=True)
first_key = docker_client.sw... | docker_client.swarm.unlock_key() | assert | func_call | tests/python_on_whales/components/test_swarm.py | test_swarm_unlock_key | 41 | null | |
cased/kit | import os
from kit import Repository
def _extract(tmpdir: str, filename: str, content: str):
path = os.path.join(tmpdir, filename)
with open(path, "w") as f:
f.write(content)
return Repository(tmpdir).extract_symbols(filename)
def test_csharp_interface(tmp_path):
"""Test interface extraction.... | types | assert | variable | tests/test_csharp_symbols.py | test_csharp_interface | 49 | null | |
cased/kit | import pytest
from kit.tree_sitter_symbol_extractor import TreeSitterSymbolExtractor
class TestJavaScriptArrowFunctions:
def clear_cache(self):
"""Clear query cache before each test."""
TreeSitterSymbolExtractor._queries.clear()
yield
def test_const_arrow_function(self):
"""A... | names | assert | variable | tests/test_arrow_function_symbols.py | test_const_arrow_function | TestJavaScriptArrowFunctions | 26 | null |
cased/kit | import re
import pytest
from kit.pr_review.priority_filter import (
MAJOR_SECTION_PATTERN,
MAX_LINES,
MIN_MEANINGFUL_LENGTH,
PRIORITY_HEADER_PATTERNS,
PRIORITY_SECTION_PATTERNS,
_extract_priority_level,
_filter_priority_content,
_is_major_section_header,
_is_meaningful_content,
... | text | assert | variable | tests/test_priority_filtering.py | test_no_priority_section | TestPriorityContentFiltering | 297 | null |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.config import ReviewConfig
from kit.pr_review.local_reviewer import LocalDiffReviewer
def mock_config():
"""Create a mock ReviewConfig."""
config = MagicMock(spec=ReviewConfig)
c... | prompt | assert | variable | tests/test_local_review_scenarios.py | test_review_large_diff | TestLocalReviewScenarios | 282 | null |
cased/kit | from unittest.mock import MagicMock, patch
import pytest
from kit.doc_providers import DocumentationService, UpstashProvider
class TestUpstashProvider:
@patch("httpx.Client.get")
def test_fetch_success(self, mock_get):
"""Test successful documentation fetch."""
mock_response = MagicMock()
... | result | assert | variable | tests/test_doc_providers.py | test_fetch_success | TestUpstashProvider | 118 | null |
cased/kit | import os
import tempfile
from kit import CodeSearcher
from kit.code_searcher import SearchOptions
def test_search_context_before():
"""Test context lines before match."""
with tempfile.TemporaryDirectory() as tmpdir:
pyfile = os.path.join(tmpdir, "test.py")
with open(pyfile, "w") as f:
... | 1 | assert | numeric_literal | tests/test_code_searcher.py | test_search_context_before | 57 | null | |
cased/kit | import subprocess
import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from kit.mcp.dev_server import KitServerLogic
def temp_git_repo():
"""Create a temporary git repository for testing."""
with tempfile.TemporaryDirectory() as temp_dir:
# Initialize git repo
... | 0 | assert | numeric_literal | tests/test_mcp_ref.py | test_open_repository_with_ref | TestMCPRefParameter | 58 | null |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.config import ReviewConfig
from kit.pr_review.local_reviewer import LocalDiffReviewer
def mock_config():
"""Create a mock ReviewConfig."""
config = MagicMock(spec=ReviewConfig)
c... | diff | assert | variable | tests/test_local_review_scenarios.py | test_review_merge_base | TestLocalReviewScenarios | 211 | null |
cased/kit | import os
import tempfile
from kit import Repository
def test_hcl_symbol_extraction():
hcl_content = """
provider "aws" {
region = "us-west-2"
}
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfa1f0"
instance_type = "t2.micro"
tags = {
Name = "WebServer"
}
}
resource "aws_s3_bucket"... | names | assert | variable | tests/test_hcl_symbols.py | test_hcl_symbol_extraction | 70 | null | |
cased/kit | from unittest.mock import MagicMock, patch
import pytest
from kit.package_search import ChromaPackageSearch
class TestPackageSearchEdgeCases:
def mock_api_key(self, monkeypatch):
"""Set mock API key for tests."""
monkeypatch.setenv("CHROMA_PACKAGE_SEARCH_API_KEY", "test_api_key")
def client... | [] | assert | collection | tests/test_package_search_edge_cases.py | test_grep_with_special_characters | TestPackageSearchEdgeCases | 39 | null |
cased/kit | import os
import tempfile
from kit import Repository
def test_hcl_symbol_extraction():
hcl_content = """
provider "aws" {
region = "us-west-2"
}
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfa1f0"
instance_type = "t2.micro"
tags = {
Name = "WebServer"
}
}
resource "aws_s3_bucket"... | types | assert | variable | tests/test_hcl_symbols.py | test_hcl_symbol_extraction | 78 | null | |
cased/kit | from unittest.mock import Mock, patch
from kit.tree_sitter_symbol_extractor import TreeSitterSymbolExtractor
class TestTreeSitterCompatibility:
def test_captures_api_fallback(self):
"""Test fallback to captures() API when matches() doesn't exist."""
code = "interface User { id: number; }"
... | "User" | assert | string_literal | tests/test_tree_sitter_compatibility.py | test_captures_api_fallback | TestTreeSitterCompatibility | 81 | null |
cased/kit | from unittest.mock import MagicMock, patch
import pytest
from kit.package_search import ChromaPackageSearch
class TestPackageSearchEdgeCases:
def mock_api_key(self, monkeypatch):
"""Set mock API key for tests."""
monkeypatch.setenv("CHROMA_PACKAGE_SEARCH_API_KEY", "test_api_key")
def client... | "abc123" | assert | string_literal | tests/test_package_search_edge_cases.py | test_read_file_with_provided_sha256 | TestPackageSearchEdgeCases | 113 | null |
cased/kit | import tempfile
import time
from pathlib import Path
from unittest.mock import patch
import pytest
from kit.incremental_analyzer import FileAnalysisCache, IncrementalAnalyzer
class TestFileAnalysisCache:
def test_stale_entry_cleanup(self):
"""Test cleanup of stale cache entries."""
with tempfile... | 0 | assert | numeric_literal | tests/test_incremental_analyzer.py | test_stale_entry_cleanup | TestFileAnalysisCache | 119 | null |
cased/kit | import os
from kit import Repository
def _extract(tmpdir: str, filename: str, content: str):
path = os.path.join(tmpdir, filename)
with open(path, "w") as f:
f.write(content)
return Repository(tmpdir).extract_symbols(filename)
def test_csharp_interface(tmp_path):
"""Test interface extraction.... | names | assert | variable | tests/test_csharp_symbols.py | test_csharp_interface | 48 | null | |
cased/kit | import tempfile
from pathlib import Path
import pytest
from kit.mcp.dev_server import (
DeepResearchParams,
LocalDevServerLogic,
)
class TestLocalDevServerLogic:
def server(self):
"""Create a server instance."""
return LocalDevServerLogic()
def test_deep_research_package(self, serve... | result | assert | variable | tests/test_dev_mcp.py | test_deep_research_package | TestLocalDevServerLogic | 65 | null |
cased/kit | from src.kit.pr_review.diff_parser import DiffHunk, DiffParser, FileDiff
def test_parse_simple_diff():
"""Test parsing a simple git diff."""
diff_content = """diff --git a/src/test.py b/src/test.py
index abc123..def456 100644
--- a/src/test.py
+++ b/src/test.py
@@ -10,5 +10,7 @@ def main():
print("hello")... | 0 | assert | numeric_literal | tests/test_diff_parser.py | test_parse_simple_diff | 58 | null | |
cased/kit | from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.error_utils import is_non_actionable_error
class TestIsNonActionableError:
def test_anthropic_context_length_exceeded(self):
msg = "Error during enhanced LLM analysis: context_length_exceeded: the prompt is too long"
as... | True | assert | bool_literal | tests/test_error_utils.py | test_anthropic_context_length_exceeded | TestIsNonActionableError | 21 | null |
cased/kit | import json
import subprocess
import tempfile
from pathlib import Path
import pytest
def temp_repo():
"""Create a temporary repository with sample files for testing."""
with tempfile.TemporaryDirectory() as tmpdir:
repo_path = Path(tmpdir)
# Create Python files
(repo_path / "main.py")... | 1 | assert | numeric_literal | tests/test_cli_integration.py | test_file_content_missing_file | TestFileOperations | 167 | null |
cased/kit | from unittest.mock import patch
from src.kit.pr_review.config import GitHubConfig, LLMConfig, LLMProvider, ReviewConfig
from src.kit.pr_review.diff_parser import DiffParser
from src.kit.pr_review.reviewer import PRReviewer
class TestDiffParsingIntegration:
def test_complex_diff_scenarios(self):
"""Test c... | ranges | assert | variable | tests/test_diff_integration.py | test_complex_diff_scenarios | TestDiffParsingIntegration | 117 | null |
cased/kit | import pytest
from kit.tree_sitter_symbol_extractor import TreeSitterSymbolExtractor
HS_SAMPLE = r"""
module A.B where
(>>=) x f = f x
add x y = x + y
f = \x -> x
newtype Age = Age Int
data Person = Person String Int
type Str = String
class Show a where
show :: a -> String
type family F a
instance Show Int whe... | None | assert | none_literal | tests/test_haskell_symbol_extraction.py | test_haskell_parser_and_query_available | 37 | null | |
cased/kit | import logging
import subprocess
import time
from unittest.mock import MagicMock, patch
from urllib.parse import urlparse
import pytest
import requests
from pydantic import BaseModel
from kit.api.app import sanitize_url, validate_repo_url
class TestAPISecurityErrorHandling:
def test_repository_creation_logs_ful... | 0 | assert | numeric_literal | tests/test_api_security.py | test_repository_creation_logs_full_details_internally | TestAPISecurityErrorHandling | 150 | null |
cased/kit | from unittest.mock import patch
from src.kit.pr_review.config import GitHubConfig, LLMConfig, LLMProvider, ReviewConfig
from src.kit.pr_review.diff_parser import DiffParser
from src.kit.pr_review.reviewer import PRReviewer
class TestDiffParsingIntegration:
def test_real_github_diff_parsing(self):
"""Test... | 2 | assert | numeric_literal | tests/test_diff_integration.py | test_real_github_diff_parsing | TestDiffParsingIntegration | 53 | null |
cased/kit | import re
import pytest
from typer.testing import CliRunner
from kit.cli import app
def runner():
"""Create a CLI runner for testing."""
return CliRunner()
def strip_ansi_codes(text: str) -> str:
"""Remove ANSI color codes from text for easier testing."""
ansi_escape = re.compile(r"\x1B(?:[@-Z\\-_]|... | 2 | assert | numeric_literal | tests/test_cli_search_semantic.py | test_missing_required_arguments | TestSearchSemanticCommand | 45 | null |
cased/kit | import tempfile
from pathlib import Path
import pytest
from kit.mcp.dev_server import (
DeepResearchParams,
LocalDevServerLogic,
)
class TestLocalDevServerLogic:
def server(self):
"""Create a server instance."""
return LocalDevServerLogic()
def test_open_repository(self, server):
... | tmpdir | assert | variable | tests/test_dev_mcp.py | test_open_repository | TestLocalDevServerLogic | 39 | null |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from typer.testing import CliRunner
from kit.cli import app
def runner():
"""Create a CLI test runner."""
return CliRunner()
def temp_git_repo():
"""Create a temporary git repository with sample c... | 0 | assert | numeric_literal | tests/test_cli_local_review.py | test_review_help | TestCLILocalReview | 70 | null |
cased/kit | import pytest
from kit.tree_sitter_symbol_extractor import TreeSitterSymbolExtractor
SAMPLES = {
".py": "def foo():\n pass\n\nclass Bar:\n pass\n",
".js": "function foo() {}\nclass Bar {}\n",
".go": "package main\n\nfunc foo() {}\n\ntype Bar struct{}\n",
".java": "class Bar { void foo() {} }\n",... | len(func_name) | assert | func_call | tests/test_symbol_extraction_multilang.py | test_symbol_code_contains_full_body | 92 | null | |
cased/kit | from unittest.mock import MagicMock, patch
import pytest
from kit.doc_providers import DocumentationService, UpstashProvider
class TestUpstashProvider:
@patch("httpx.Client.get")
def test_search_rate_limited(self, mock_get):
"""Test search when rate limited."""
mock_response = MagicMock()
... | [] | assert | collection | tests/test_doc_providers.py | test_search_rate_limited | TestUpstashProvider | 81 | null |
cased/kit | import tempfile
from pathlib import Path
import pytest
from kit.context_extractor import ContextExtractor
from kit.repo_mapper import RepoMapper
from kit.repository import Repository
from kit.utils import validate_relative_path
class TestValidateRelativePath:
def test_normal_paths_allowed(self):
"""Test... | base / "test.py" | assert | complex_expr | tests/test_path_validation.py | test_normal_paths_allowed | TestValidateRelativePath | 24 | null |
cased/kit | from unittest.mock import MagicMock, patch
import pytest
from kit.doc_providers import DocumentationService, UpstashProvider
class TestUpstashProvider:
@patch("httpx.Client.get")
def test_fetch_success(self, mock_get):
"""Test successful documentation fetch."""
mock_response = MagicMock()
... | None | assert | none_literal | tests/test_doc_providers.py | test_fetch_success | TestUpstashProvider | 117 | null |
cased/kit | import re
import pytest
from typer.testing import CliRunner
from kit.cli import app
def runner():
"""Create a CLI runner for testing."""
return CliRunner()
def strip_ansi_codes(text: str) -> str:
"""Remove ANSI color codes from text for easier testing."""
ansi_escape = re.compile(r"\x1B(?:[@-Z\\-_]|... | 0 | assert | numeric_literal | tests/test_cli_search_semantic.py | test_help_message | TestSearchSemanticCommand | 30 | null |
cased/kit | from kit.tree_sitter_symbol_extractor import TreeSitterSymbolExtractor
def test_tsx_duplicate_symbols():
"""Ensure TSX (using TypeScript fallback queries) does not return duplicate symbols."""
code = """
import React from 'react';
export interface Props {
title: string;
}
export class Header extends React.... | names | assert | variable | tests/test_tsx_duplicate_symbols.py | test_tsx_duplicate_symbols | 34 | null | |
cased/kit | import tempfile
from pathlib import Path
import pytest
from kit.context_extractor import ContextExtractor
from kit.repo_mapper import RepoMapper
from kit.repository import Repository
from kit.utils import validate_relative_path
class TestValidateRelativePath:
def test_empty_path_returns_base(self):
"""T... | base | assert | variable | tests/test_path_validation.py | test_empty_path_returns_base | TestValidateRelativePath | 39 | null |
cased/kit | from unittest.mock import MagicMock, patch
import pytest
from kit.package_search import ChromaPackageSearch
class TestPackageSearchEdgeCases:
def mock_api_key(self, monkeypatch):
"""Set mock API key for tests."""
monkeypatch.setenv("CHROMA_PACKAGE_SEARCH_API_KEY", "test_api_key")
def client... | "py_pi" | assert | string_literal | tests/test_package_search_edge_cases.py | test_get_package_info_basic | TestPackageSearchEdgeCases | 197 | null |
cased/kit | from unittest.mock import MagicMock, patch
import pytest
from kit.doc_providers import DocumentationService, UpstashProvider
class TestMCPIntegration:
def dev_server_logic(self):
"""Create a LocalDevServerLogic instance for testing."""
from kit.mcp.dev_server import LocalDevServerLogic
... | 1 | assert | numeric_literal | tests/test_doc_providers.py | test_deep_research_returns_guidance_on_failure | TestMCPIntegration | 365 | null |
cased/kit | from unittest.mock import MagicMock, Mock, patch
import pytest
from kit.pr_review.config import GitHubConfig, LLMConfig, LLMProvider, ReviewConfig
from kit.pr_review.cost_tracker import CostTracker
from kit.summaries import LLMError, OllamaConfig, Summarizer, _strip_thinking_tokens
def mock_repo():
"""Provides a... | result | assert | variable | tests/test_ollama_integration.py | test_ollama_deepseek_r1_thinking_token_stripping | TestOllamaThinkingTokenIntegration | 366 | null |
cased/kit | from kit import ContextAssembler, Repository
def test_context_assembler_basic(tmp_path):
# Create a simple repo with one file
file_path = tmp_path / "foo.py"
file_path.write_text("print('hi')\n")
repo = Repository(str(tmp_path))
assembler = ContextAssembler(repo)
assembler.add_file("foo.py")
... | ctx | assert | variable | tests/test_context_assembler.py | test_context_assembler_basic | 14 | null | |
cased/kit | import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from kit import Repository
from kit.mcp.dev_server import KitServerLogic
class TestGrepIntegration:
def test_python_api_grep(self, test_repo):
"""Test grep functionality through Python API."""
repo = Repositor... | files | assert | variable | tests/test_grep_integration.py | test_python_api_grep | TestGrepIntegration | 48 | null |
cased/kit | import subprocess
import tempfile
from pathlib import Path
import pytest
from kit import Repository
def test_grep_directory_filtering():
"""Test directory parameter for limiting search scope."""
with tempfile.TemporaryDirectory() as temp_dir:
repo_path = Path(temp_dir)
# Create directory str... | 5 | assert | numeric_literal | tests/test_grep_functionality.py | test_grep_directory_filtering | 169 | null | |
cased/kit | import re
from src.kit.pr_review.diff_parser import DiffParser
from src.kit.pr_review.validator import validate_review_quality
class TestRealWorldScenarios:
def test_multi_file_line_accuracy(self):
"""Test line number accuracy across multiple files."""
multi_file_diff = """diff --git a/models/use... | 4 | assert | numeric_literal | tests/test_line_accuracy_validation.py | test_multi_file_line_accuracy | TestRealWorldScenarios | 302 | null |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.config import ReviewConfig
from kit.pr_review.local_reviewer import LocalDiffReviewer
def mock_config():
"""Create a mock ReviewConfig."""
config = MagicMock(spec=ReviewConfig)
c... | result | assert | variable | tests/test_local_review_scenarios.py | test_review_empty_diff | TestLocalReviewScenarios | 317 | null |
cased/kit | import subprocess
import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from kit.mcp.dev_server import KitServerLogic
def temp_git_repo():
"""Create a temporary git repository for testing."""
with tempfile.TemporaryDirectory() as temp_dir:
# Initialize git repo
... | 7 | assert | numeric_literal | tests/test_mcp_ref.py | test_get_git_info | TestMCPRefParameter | 126 | null |
cased/kit | import json
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
import typer.testing
from kit.cli import app
def runner():
"""Create a typer test runner."""
return typer.testing.CliRunner()
def mock_repo():
"""Create a mock Repository instance."""
with p... | 1 | assert | numeric_literal | tests/test_cli.py | test_file_tree_error | TestFileTreeCommand | 161 | null |
cased/kit | from unittest.mock import Mock, patch
import pytest
from kit.mcp.dev_server import KitServerLogic
class TestGrepAST:
def logic(self):
return KitServerLogic()
def mock_repo(self):
repo = Mock()
repo.repo_path = "/test/repo"
return repo
def test_grep_ast_simple_mode(self,... | result[0] | assert | complex_expr | tests/mcp/test_grep_ast.py | test_grep_ast_simple_mode | TestGrepAST | 49 | null |
cased/kit | import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.base_reviewer import BaseReviewer
from kit.pr_review.config import GitHubConfig, LLMConfig, LLMProvider, ReviewConfig
def review_config():
"""Create a test ReviewConfig."""
return ReviewConfig... | "repo" | assert | string_literal | tests/test_base_reviewer.py | test_parses_standard_github_url | TestParsePrUrl | 68 | null |
cased/kit | from src.kit.pr_review.diff_parser import DiffHunk, DiffParser, FileDiff
def test_parse_hunk_header():
"""Test parsing of diff hunk headers."""
# Standard hunk header
header = "@@ -10,5 +12,7 @@"
hunk = DiffParser._parse_hunk_header(header)
assert hunk is not None
assert hunk.old_start == 10
... | 5 | assert | numeric_literal | tests/test_diff_parser.py | test_parse_hunk_header | 14 | null | |
cased/kit | from src.kit.pr_review.diff_parser import DiffHunk, DiffParser, FileDiff
def test_multiple_files_diff():
"""Test parsing diff with multiple files."""
diff_content = """diff --git a/file1.py b/file1.py
index abc123..def456 100644
--- a/file1.py
+++ b/file1.py
@@ -1,3 +1,4 @@
def func1():
+ print("added")
... | 2 | assert | numeric_literal | tests/test_diff_parser.py | test_multiple_files_diff | 85 | null | |
cased/kit | import re
import pytest
from kit.pr_review.priority_filter import (
MAJOR_SECTION_PATTERN,
MAX_LINES,
MIN_MEANINGFUL_LENGTH,
PRIORITY_HEADER_PATTERNS,
PRIORITY_SECTION_PATTERNS,
_extract_priority_level,
_filter_priority_content,
_is_major_section_header,
_is_meaningful_content,
... | result | assert | variable | tests/test_priority_filtering.py | test_filter_high_priority_only | TestFilterReviewByPriority | 136 | null |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from kit.mcp.dev_server import (
GetFileTreeParams,
LocalDevServerLogic,
WarmCacheParams,
)
from kit.repository import Repository
class TestFileTreePagination:
def server_with_repo(self):
"""Crea... | True | assert | bool_literal | tests/test_large_codebase.py | test_pagination_has_more | TestFileTreePagination | 130 | null |
cased/kit | import re
import pytest
from typer.testing import CliRunner
from kit.cli import app
def runner():
"""Create a CLI runner for testing."""
return CliRunner()
def strip_ansi_codes(text: str) -> str:
"""Remove ANSI color codes from text for easier testing."""
ansi_escape = re.compile(r"\x1B(?:[@-Z\\-_]|... | result.output | assert | complex_expr | tests/test_cli_search_semantic.py | test_invalid_chunk_by_parameter | TestSearchSemanticCommand | 61 | null |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.config import ReviewConfig
from kit.pr_review.local_reviewer import LocalChange, LocalDiffReviewer
def mock_config():
"""Create a mock ReviewConfig for testing."""
config = MagicMock... | 0 | assert | numeric_literal | tests/test_local_review.py | test_get_changed_files | TestLocalDiffReviewer | 134 | null |
cased/kit | import json
import subprocess
import tempfile
from pathlib import Path
import pytest
import typer.testing
from kit.cli import app
def runner():
"""Create a typer test runner."""
return typer.testing.CliRunner()
def temp_git_repo():
"""Create a temporary git repository for testing."""
with tempfile.T... | output | assert | variable | tests/test_cli_ref.py | test_git_info_command | TestCLIRefParameter | 65 | null |
cased/kit | import subprocess
import tempfile
from pathlib import Path
from src.kit.api.registry import PersistentRepoRegistry, _canonical, path_to_id
class TestRegistryDeterministicIDs:
def test_remote_url_with_ref(self):
"""Test deterministic IDs for remote URLs with refs."""
registry = PersistentRepoRegis... | id2 | assert | variable | tests/test_registry_deterministic.py | test_remote_url_with_ref | TestRegistryDeterministicIDs | 109 | null |
cased/kit | import logging
import os
import time
from pathlib import Path
import pytest
from kit.repository import Repository
def _make_repo_dir(root: Path, name: str, mtime_offset_hours: float = 0.0) -> Path:
"""Helper to create a dummy repo directory with an adjusted *mtime*."""
repo_dir = root / name
repo_dir.mkd... | None | assert | none_literal | tests/test_cache_cleanup.py | test_env_var_ttl_invalid | 60 | null | |
cased/kit | import pytest
from kit.tree_sitter_symbol_extractor import TreeSitterSymbolExtractor
HS_SAMPLE = r"""
module A.B where
(>>=) x f = f x
add x y = x + y
f = \x -> x
newtype Age = Age Int
data Person = Person String Int
type Str = String
class Show a where
show :: a -> String
type family F a
instance Show Int whe... | 1 | assert | numeric_literal | tests/test_haskell_symbol_extraction.py | test_haskell_symbols_if_available | 64 | null | |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.config import ReviewConfig
from kit.pr_review.local_reviewer import LocalDiffReviewer
def mock_config():
"""Create a mock ReviewConfig."""
config = MagicMock(spec=ReviewConfig)
c... | "" | assert | string_literal | tests/test_local_review_scenarios.py | test_review_empty_diff | TestLocalReviewScenarios | 313 | null |
cased/kit | import re
from src.kit.pr_review.diff_parser import DiffParser
from src.kit.pr_review.validator import validate_review_quality
class TestLineNumberValidation:
def test_github_link_format_validation(self):
"""Test validation of GitHub link formats in reviews."""
valid_links = [
"[file.... | None | assert | none_literal | tests/test_line_accuracy_validation.py | test_github_link_format_validation | TestLineNumberValidation | 184 | null |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.config import ReviewConfig
from kit.pr_review.local_reviewer import LocalDiffReviewer
def mock_config():
"""Create a mock ReviewConfig."""
config = MagicMock(spec=ReviewConfig)
c... | result | assert | variable | tests/test_local_review_edge_cases.py | test_review_with_no_changes | TestLocalReviewEdgeCases | 168 | null |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.config import ReviewConfig
from kit.pr_review.local_reviewer import LocalDiffReviewer
def mock_config():
"""Create a mock ReviewConfig."""
config = MagicMock(spec=ReviewConfig)
c... | "added" | assert | string_literal | tests/test_local_review_scenarios.py | test_review_single_file_change | TestLocalReviewScenarios | 185 | null |
cased/kit | import json
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
import typer.testing
from kit.cli import app
def runner():
"""Create a typer test runner."""
return typer.testing.CliRunner()
def mock_repo():
"""Create a mock Repository instance."""
with p... | 0 | assert | numeric_literal | tests/test_cli.py | test_review_plain_flag | TestReviewCommand | 51 | null |
cased/kit | import json
import os
import tempfile
from kit import MultiRepo, Repository
def create_test_repo(tmpdir: str, name: str, files: dict) -> str:
"""Create a test repository with given files."""
repo_path = os.path.join(tmpdir, name)
os.makedirs(repo_path, exist_ok=True)
for file_path, content in files.i... | 2 | assert | numeric_literal | tests/test_multi_repo.py | test_multi_repo_basic | 44 | null | |
cased/kit | import tempfile
from pathlib import Path
import pytest
from kit.context_extractor import ContextExtractor
from kit.repo_mapper import RepoMapper
from kit.repository import Repository
from kit.utils import validate_relative_path
class TestRepositoryPathValidation:
def test_get_abs_path_validation(self):
... | result | assert | variable | tests/test_path_validation.py | test_get_abs_path_validation | TestRepositoryPathValidation | 116 | null |
cased/kit | from unittest.mock import MagicMock, patch
import pytest
from kit.tree_sitter_symbol_extractor import TreeSitterSymbolExtractor
class TestSymbolTypeProcessing:
def test_symbol_type_from_fallback_label_class(self):
"""Test that @class correctly becomes 'class'."""
# Mock similar to above but with... | "class" | assert | string_literal | tests/test_tree_sitter_symbol_extractor.py | test_symbol_type_from_fallback_label_class | TestSymbolTypeProcessing | 81 | null |
cased/kit | from unittest.mock import MagicMock, patch
import pytest
from kit.package_search import ChromaPackageSearch
class TestChromaPackageSearch:
def mock_api_key(self, monkeypatch):
"""Set mock API key for tests."""
monkeypatch.setenv("CHROMA_PACKAGE_SEARCH_API_KEY", "test_api_key")
def client(se... | "numpy" | assert | string_literal | tests/test_package_search.py | test_grep_success | TestChromaPackageSearch | 69 | null |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.config import ReviewConfig
from kit.pr_review.local_reviewer import LocalDiffReviewer
def mock_config():
"""Create a mock ReviewConfig."""
config = MagicMock(spec=ReviewConfig)
c... | 3 | assert | numeric_literal | tests/test_local_review_scenarios.py | test_review_multiple_file_changes | TestLocalReviewScenarios | 196 | null |
cased/kit | from unittest.mock import Mock, patch
from kit.tree_sitter_symbol_extractor import TreeSitterSymbolExtractor
class TestTreeSitterCompatibility:
def test_matches_api_attribute_error(self):
"""Test handling when matches() exists but throws AttributeError."""
code = "class Test {}"
# Mock q... | "Test" | assert | string_literal | tests/test_tree_sitter_compatibility.py | test_matches_api_attribute_error | TestTreeSitterCompatibility | 111 | null |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from typer.testing import CliRunner
from kit.cli import app
from kit.pr_review.local_reviewer import LocalDiffReviewer
def runner():
"""Create a CLI test runner."""
return CliRunner()
def temp_git_rep... | 1 | assert | numeric_literal | tests/test_local_diff_parsing.py | test_invalid_ref_in_repo | TestLocalDiffErrorHandling | 284 | null |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from typer.testing import CliRunner
from kit.cli import app
from kit.pr_review.local_reviewer import LocalDiffReviewer
def runner():
"""Create a CLI test runner."""
return CliRunner()
def temp_git_rep... | result.output | assert | complex_expr | tests/test_local_diff_parsing.py | test_repo_path_handling | TestLocalDiffCLIParsing | 239 | null |
cased/kit | from kit import Repository
def make_repo(tmp_path):
repo_root = tmp_path / "repo"
repo_root.mkdir()
return repo_root
def test_skip_by_filename(tmp_path):
repo_root = make_repo(tmp_path)
(repo_root / "package-lock.json").write_text("{}\n")
repo = Repository(str(repo_root))
assembler = repo... | ctx | assert | variable | tests/test_context_assembler_limits.py | test_skip_by_filename | 24 | null | |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from kit.mcp.dev_server import (
GetFileTreeParams,
LocalDevServerLogic,
WarmCacheParams,
)
from kit.repository import Repository
class TestGrepTimeoutAndEarlyTermination:
def repo(self):
"""Crea... | 0 | assert | numeric_literal | tests/test_large_codebase.py | test_grep_timeout_parameter | TestGrepTimeoutAndEarlyTermination | 53 | null |
cased/kit | import subprocess
import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from kit.mcp.dev_server import KitServerLogic
def temp_git_repo():
"""Create a temporary git repository for testing."""
with tempfile.TemporaryDirectory() as temp_dir:
# Initialize git repo
... | True | assert | bool_literal | tests/test_mcp_ref.py | test_grep_params_model | TestMCPRefParameter | 398 | null |
cased/kit | from unittest.mock import patch
from src.kit.pr_review.config import GitHubConfig, LLMConfig, LLMProvider, ReviewConfig
from src.kit.pr_review.diff_parser import DiffParser
from src.kit.pr_review.reviewer import PRReviewer
class TestDiffParsingIntegration:
def test_edge_case_diffs(self):
"""Test edge cas... | 0 | assert | numeric_literal | tests/test_diff_integration.py | test_edge_case_diffs | TestDiffParsingIntegration | 159 | null |
cased/kit | import json
import os
import sys
import tempfile
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
from kit import Repository
def test_file_dependencies():
"""Test getting detailed dependency information for a specific file."""
with tempfile.TemporaryDirectory() as tmpdir... | "app.py" | assert | string_literal | tests/test_python_dependency_analyzer.py | test_file_dependencies | 234 | null | |
cased/kit | import hashlib
import shutil
from pathlib import Path
from unittest.mock import MagicMock
import pytest
from kit import DocstringIndexer, Repository
from kit.vector_searcher import VectorDBBackend
FIXTURE_REPO = Path(__file__).parent / "fixtures" / "realistic_repo"
def realistic_repo(tmp_path):
# Copy fixture r... | 0 | assert | numeric_literal | tests/test_docstring_incremental.py | test_incremental_indexing | 83 | null | |
cased/kit | from kit.tree_sitter_symbol_extractor import TreeSitterSymbolExtractor
def test_typescript_duplicate_symbols():
"""Ensure that exported TypeScript constructs are not duplicated in symbol extraction."""
code = """
export class MyClass {
public value: number;
constructor(value: number) {
this.value = va... | len(set(keys)) | assert | func_call | tests/test_typescript_duplicate_symbols.py | test_typescript_duplicate_symbols | 30 | null | |
cased/kit | import os
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.config import ReviewConfig
from kit.pr_review.local_reviewer import LocalChange, LocalDiffReviewer
def mock_config():
"""Create a mock ReviewConfig for testing."""
config = MagicMock... | "HEAD" | assert | string_literal | tests/test_local_review.py | test_parse_diff_spec | TestLocalDiffReviewer | 74 | null |
cased/kit | import os
import subprocess
import time
import pytest
import requests
from kit import Repository
from kit.pr_review.config import GitHubConfig, LLMConfig, LLMProvider, ReviewConfig
from kit.pr_review.cost_tracker import CostTracker
from kit.pr_review.reviewer import PRReviewer
from kit.summaries import OllamaConfig
... | summary.lower() | assert | func_call | tests/test_ollama_integration_real.py | test_ollama_function_summarization_real | TestOllamaIntegration | 134 | null |
cased/kit | import re
import pytest
from kit.pr_review.priority_filter import (
MAJOR_SECTION_PATTERN,
MAX_LINES,
MIN_MEANINGFUL_LENGTH,
PRIORITY_HEADER_PATTERNS,
PRIORITY_SECTION_PATTERNS,
_extract_priority_level,
_filter_priority_content,
_is_major_section_header,
_is_meaningful_content,
... | [] | assert | collection | tests/test_priority_filtering.py | test_validate_priorities_empty_input | TestPriorityEnum | 67 | null |
cased/kit | from kit.pr_review.line_ref_fixer import LineRefFixer
SIMPLE_DIFF = """diff --git a/foo.py b/foo.py
@@ -10,3 +10,4 @@ def func():
a = 1
- b = 2
+ b = 3
+ c = 4
"""
BAD_COMMENT = "Issue at foo.py:10 is wrong. Another range foo.py:10-11 is wrong too."
def test_line_ref_fix_range_both_endpoints():
"""... | 2 | assert | numeric_literal | tests/test_line_ref_fix.py | test_line_ref_fix_range_both_endpoints | 98 | null | |
cased/kit | import json
import os
import sys
import tempfile
from pathlib import Path
import pytest
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
from kit import Repository
def test_terraform_dependency_analyzer_basic():
"""Test basic functionality of the TerraformDependencyAnalyzer."""
with tempfile.Te... | graph | assert | variable | tests/test_terraform_dependency_analyzer.py | test_terraform_dependency_analyzer_basic | 45 | null | |
cased/kit | from unittest.mock import MagicMock, patch
class TestOllamaClient:
def test_generate_handles_empty_response(self):
"""Test that generate handles missing response field."""
from kit.ollama_client import OllamaClient
mock_session = MagicMock()
mock_response = MagicMock()
moc... | "" | assert | string_literal | tests/test_ollama_client.py | test_generate_handles_empty_response | TestOllamaClient | 81 | null |
cased/kit | import os
from kit import Repository
def _extract(tmpdir: str, filename: str, content: str):
path = os.path.join(tmpdir, filename)
with open(path, "w") as f:
f.write(content)
return Repository(tmpdir).extract_symbols(filename)
def test_csharp_namespace_qualified(tmp_path):
"""Test qualified n... | 1 | assert | numeric_literal | tests/test_csharp_symbols.py | test_csharp_namespace_qualified | 151 | null | |
cased/kit | import subprocess
import tempfile
from pathlib import Path
import pytest
from kit import Repository
def test_grep_basic():
"""Test basic grep functionality."""
with tempfile.TemporaryDirectory() as temp_dir:
repo_path = Path(temp_dir)
# Create test files with content
(repo_path / "ma... | 2 | assert | numeric_literal | tests/test_grep_functionality.py | test_grep_basic | 24 | null | |
cased/kit | import subprocess
import tempfile
from pathlib import Path
import pytest
from kit import Repository
def test_grep_include_exclude_patterns():
"""Test include/exclude file patterns."""
with tempfile.TemporaryDirectory() as temp_dir:
repo_path = Path(temp_dir)
# Create files with same content ... | files | assert | variable | tests/test_grep_functionality.py | test_grep_include_exclude_patterns | 79 | null | |
cased/kit | import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from kit import Repository
from kit.mcp.dev_server import KitServerLogic
class TestGrepIntegration:
def test_python_api_grep(self, test_repo):
"""Test grep functionality through Python API."""
repo = Repositor... | 3 | assert | numeric_literal | tests/test_grep_integration.py | test_python_api_grep | TestGrepIntegration | 46 | null |
cased/kit | import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
from kit.pr_review.base_reviewer import BaseReviewer
from kit.pr_review.config import GitHubConfig, LLMConfig, LLMProvider, ReviewConfig
def review_config():
"""Create a test ReviewConfig."""
return ReviewConfig... | "owner" | assert | string_literal | tests/test_base_reviewer.py | test_parses_standard_github_url | TestParsePrUrl | 67 | null |
cased/kit | import tempfile
from pathlib import Path
import pytest
from kit.mcp.dev_server import (
DeepResearchParams,
LocalDevServerLogic,
)
class TestLocalDevServerLogic:
def server(self):
"""Create a server instance."""
return LocalDevServerLogic()
def test_open_repository(self, server):
... | server._repos | assert | complex_expr | tests/test_dev_mcp.py | test_open_repository | TestLocalDevServerLogic | 38 | null |
cased/kit |
# Simulate payment gateway call
gateway_response = self._call_payment_gateway(amount, card_number)
transaction = {
'id': transaction_id,
'amount': amount,
'status': gateway_response['status'],
'timestamp': datetime.now(),
'card_last_f... | output | assert | variable | tests/test_search_semantic_integration.py | test_semantic_search_authentication_concepts | TestSemanticSearchIntegration | 748 | null |
cased/kit | import tempfile
from pathlib import Path
from kit import ContextExtractor
def test_chunk_file_by_lines():
with tempfile.TemporaryDirectory() as tmpdir:
fpath = f"{tmpdir}/test.py"
with open(fpath, "w") as f:
f.write(("def foo():\n pass\ndef bar():\n pass\n") * 10)
extract... | 0 | assert | numeric_literal | tests/test_context_extractor.py | test_chunk_file_by_lines | 14 | null | |
cased/kit | import tempfile
from kit import RepoMapper
def test_extract_symbols():
with tempfile.TemporaryDirectory() as tmpdir:
pyfile = f"{tmpdir}/a.py"
with open(pyfile, "w") as f:
f.write("""
class Foo:
def bar(self): pass
def baz(): pass
""")
mapper = RepoMapper(tmpdir)
s... | types | assert | variable | tests/test_repo_mapper.py | test_extract_symbols | 36 | null | |
cased/kit | import importlib
import os
import tempfile
from pathlib import Path
from typing import List
import pytest
from kit import Repository
from kit.vector_searcher import VectorSearcher, _resolve_batch_size
def _reset_chroma_system():
yield
_ssc.SharedSystemClient._identifier_to_system.clear()
def dummy_embed(tex... | limit | assert | variable | tests/test_vector_searcher.py | test_vector_searcher_batches_respect_env_limit | 276 | null | |
cased/kit | import json
import os
import sys
import tempfile
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
from kit import Repository
def test_dependency_analyzer_exports():
"""Test the export functionality of the DependencyAnalyzer."""
with tempfile.TemporaryDirectory() as tmpdi... | data | assert | variable | tests/test_python_dependency_analyzer.py | test_dependency_analyzer_exports | 132 | null | |
cased/kit | import os
import tempfile
import pytest
from kit import Repository
def test_repo_get_file_content():
with tempfile.TemporaryDirectory() as tmpdir:
# Setup: Create some test files
content1 = "Hello, world!\nThis is a test file."
file1_path = "dir1/file1.txt"
full_file1_path = os.pa... | "" | assert | string_literal | tests/test_repo.py | test_repo_get_file_content | 123 | null | |
cased/kit | from unittest.mock import patch
from src.kit.pr_review.config import GitHubConfig, LLMConfig, LLMProvider, ReviewConfig
from src.kit.pr_review.diff_parser import DiffParser
from src.kit.pr_review.reviewer import PRReviewer
class TestDiffParsingIntegration:
def test_real_github_diff_parsing(self):
"""Test... | 8 | assert | numeric_literal | tests/test_diff_integration.py | test_real_github_diff_parsing | TestDiffParsingIntegration | 69 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.