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
boringdata/boring-semantic-layer
import ibis from boring_semantic_layer.api import to_semantic_table from boring_semantic_layer.graph_utils import ( graph_bfs, graph_invert, graph_predecessors, graph_successors, graph_to_dict, ) def test_bfs_simple_chain(): """Test BFS on a simple dependency chain.""" tbl = ibis.memtable(...
4
assert
numeric_literal
src/boring_semantic_layer/tests/test_dependency_graph.py
test_bfs_simple_chain
337
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def airports_table(con): """Create airports test data.""" airports_df = pd.DataFrame( { "code"...
4
assert
numeric_literal
src/boring_semantic_layer/tests/test_index.py
test_index_specific_dimension_string
TestBasicIndex
127
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def test_mixed_session_and_hit_level(): """Test mixing session-level and hit-level measures in same query.""" con = ibis.duckdb.connect(":memory:") data = pd.DataFrame( { "session_id": [1...
1
assert
numeric_literal
src/boring_semantic_layer/tests/test_nested_access.py
test_mixed_session_and_hit_level
153
null
boringdata/boring-semantic-layer
import pandas as pd import pytest from boring_semantic_layer.chart.utils import ( clean_field_name, convert_datetime_to_strings, detect_chart_type_generic, detect_time_dimension_from_dtype, get_non_time_dimensions, has_time_dimension, melt_dataframe_for_multiple_measures, pivot_datafram...
"bar"
assert
string_literal
src/boring_semantic_layer/chart/tests/test_utils.py
test_detect_bar_chart_categorical
TestChartTypeDetection
210
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from boring_semantic_layer import SemanticModel from boring_semantic_layer.xorq_convert import from_tagged, to_tagged, try_import_xorq class TestXorqPandasBackend: def test_pandas_backend_execution(self): """Test executing with Pandas backend.""" ...
[4, 5, 6]
assert
collection
src/boring_semantic_layer/tests/test_xorq_backends.py
test_pandas_backend_execution
TestXorqPandasBackend
192
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """Create an in-memory DuckDB connection.""" return ibis.duckdb.connect(":memory:") def flights(con): """Create a sample flights table for testing.""" df = pd.DataFrame( { ...
df.columns
assert
complex_expr
src/boring_semantic_layer/tests/test_filter_with_dimensions.py
test_filter_then_with_dimensions
59
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table class TestFilterPushdown: def models(self): con = ibis.duckdb.connect(":memory:") customers_tbl = con.create_table( "customers", pd.DataFrame( ...
1
assert
numeric_literal
src/boring_semantic_layer/tests/test_bi_traps.py
test_filter_with_chasm
TestFilterPushdown
973
null
boringdata/boring-semantic-layer
import pandas as pd import pytest from boring_semantic_layer.chart.utils import ( clean_field_name, convert_datetime_to_strings, detect_chart_type_generic, detect_time_dimension_from_dtype, get_non_time_dimensions, has_time_dimension, melt_dataframe_for_multiple_measures, pivot_datafram...
"field"
assert
string_literal
src/boring_semantic_layer/chart/tests/test_utils.py
test_clean_field_name_with_prefix
TestFieldNameUtils
26
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from boring_semantic_layer.xorq_convert import from_tagged, to_tagged, try_import_xorq class TestMalloyModelsRoundTrip: def test_sessionization_model_roundtrip(self): """Test sessionization pattern from test_malloy_inspired.py.""" import ibis ...
[1, 2]
assert
collection
src/boring_semantic_layer/tests/test_malloy_xorq_roundtrip.py
test_sessionization_model_roundtrip
TestMalloyModelsRoundTrip
89
null
boringdata/boring-semantic-layer
import pandas as pd import pytest from boring_semantic_layer.chart.utils import ( clean_field_name, convert_datetime_to_strings, detect_chart_type_generic, detect_time_dimension_from_dtype, get_non_time_dimensions, has_time_dimension, melt_dataframe_for_multiple_measures, pivot_datafram...
"table"
assert
string_literal
src/boring_semantic_layer/chart/tests/test_utils.py
test_detect_table_complex_query
TestChartTypeDetection
245
null
boringdata/boring-semantic-layer
from unittest.mock import Mock, patch import pytest pytest.importorskip("langchain", reason="langchain not installed") def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"category", "region"} mock_model.measures = {"count", "total"} mock_model.description ...
"plotly"
assert
string_literal
src/boring_semantic_layer/agents/tests/test_langgraph_backend.py
test_init_with_profile
TestLangGraphBackendInit
90
null
boringdata/boring-semantic-layer
import json import ibis import pandas as pd import pytest from fastmcp import Client from fastmcp.exceptions import ToolError from boring_semantic_layer import MCPSemanticModel, to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def sample_models(con):...
2
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_semantic_mcp.py
test_list_models
TestListModels
118
null
boringdata/boring-semantic-layer
import json from typing import Annotated, Any import ibis import pytest from pydantic import TypeAdapter, ValidationError from pydantic.functional_validators import BeforeValidator from boring_semantic_layer import MCPSemanticModel, to_semantic_table pytestmark = pytest.mark.anyio def anyio_backend(): return "a...
items
assert
variable
src/boring_semantic_layer/tests/test_mcp_json_parsing.py
test_order_by_has_items_in_schema
TestSchemaGeneration
209
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
parsed
assert
variable
src/boring_semantic_layer/chart/tests/test_backends.py
test_plotly_json_format
TestChartFormats
292
null
boringdata/boring-semantic-layer
import ibis import pandas as pd from boring_semantic_layer import to_semantic_table def test_empty_semantic_table(): """Test that an empty semantic table has no dimensions or measures.""" con = ibis.duckdb.connect(":memory:") df = pd.DataFrame({"col1": [1, 2, 3]}) tbl = con.create_table("test", df) ...
()
assert
collection
src/boring_semantic_layer/tests/test_introspection.py
test_empty_semantic_table
22
null
boringdata/boring-semantic-layer
import ibis import pytest from ibis.expr.operations.relations import Aggregate from boring_semantic_layer.expr import SemanticModel from boring_semantic_layer.graph_utils import ( bfs, find_dimensions_and_measures, find_entity_dimensions, find_event_timestamp_dimensions, gen_children_of, replac...
True
assert
bool_literal
src/boring_semantic_layer/tests/test_graph_utils.py
test_find_entity_dimensions_with_entities
125
null
boringdata/boring-semantic-layer
import sys from pathlib import Path import pytest class TestDependencyGroupDocumentation: def test_all_dependency_groups_in_dev(self): """Verify dev dependency group includes all optional dependencies.""" # Use tomllib (Python 3.11+) or tomli (Python 3.10) if sys.version_info >= (3, 11): ...
0
assert
numeric_literal
src/boring_semantic_layer/tests/test_dependency_groups.py
test_all_dependency_groups_in_dev
TestDependencyGroupDocumentation
86
null
boringdata/boring-semantic-layer
import json from pathlib import Path from unittest.mock import Mock, patch import pytest from returns.result import Failure, Success def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"carrier", "origin", "destination"} mock_model.measures = {"flight_count", "a...
4
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_tools.py
test_tool_definitions_is_list
TestToolDefinitions
28
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from boring_semantic_layer import SemanticModel from boring_semantic_layer.xorq_convert import from_tagged, to_tagged, try_import_xorq class TestXorqFeatures: def test_xorq_noop_tag_preservation(self): """Test that xorq noop tags preserve query structure....
len(df_tagged)
assert
func_call
src/boring_semantic_layer/tests/test_xorq_integration.py
test_xorq_noop_tag_preservation
TestXorqFeatures
247
null
boringdata/boring-semantic-layer
import contextlib import ibis import pytest from boring_semantic_layer import to_semantic_table, to_untagged pytestmark = pytest.mark.xfail( reason="Projection pushdown disabled for xorq vendored ibis compatibility" ) def wide_table(ibis_con): """Create a wide table with many unused columns.""" # Create...
sql.lower()
assert
func_call
src/boring_semantic_layer/tests/test_config_projection_pushdown.py
test_projection_pushdown_filters_unused_columns
TestProjectionPushdown
105
null
boringdata/boring-semantic-layer
import ibis import json import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.Data...
"bar"
assert
string_literal
src/boring_semantic_layer/chart/tests/test_echarts.py
test_basic_bar_chart
TestEChartsBasicCharts
79
null
boringdata/boring-semantic-layer
from unittest.mock import Mock, patch import pytest pytest.importorskip("langchain", reason="langchain not installed") def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"category", "region"} mock_model.measures = {"count", "total"} mock_model.description ...
0
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_langgraph_backend.py
test_reset_history
TestLangGraphBackendHistory
228
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table def test_deferred_in_with_dimensions(): """Test using deferred expressions in with_dimensions().""" con = ibis.duckdb.connect(":memory:") flights = pd.DataFrame( { "carr...
0
assert
numeric_literal
src/boring_semantic_layer/tests/test_deferred_api.py
test_deferred_in_with_dimensions
55
null
boringdata/boring-semantic-layer
import ibis import pytest from boring_semantic_layer.api import to_semantic_table from boring_semantic_layer.query import Filter, query class TestFilterValueConversion: def test_non_date_string_passthrough(self): """Test that non-date strings pass through unchanged.""" f = Filter(filter={"field":...
"USA"
assert
string_literal
src/boring_semantic_layer/tests/test_date_filter_fix.py
test_non_date_string_passthrough
TestFilterValueConversion
277
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
0
assert
numeric_literal
src/boring_semantic_layer/chart/tests/test_backends.py
test_single_value_indicator
TestPlotlyChartTypes
126
null
boringdata/boring-semantic-layer
import sys import tempfile from pathlib import Path import pytest sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent.parent / "docs" / "md")) from validate_links import ( extract_markdown_links, extract_routes_from_app_tsx, validate_links, ) class TestValidateLinks: def test_valid_lin...
[]
assert
collection
src/boring_semantic_layer/chart/tests/test_doc_builder.py
test_valid_links
TestValidateLinks
184
null
boringdata/boring-semantic-layer
import pandas as pd import pytest from boring_semantic_layer.chart.utils import ( clean_field_name, convert_datetime_to_strings, detect_chart_type_generic, detect_time_dimension_from_dtype, get_non_time_dimensions, has_time_dimension, melt_dataframe_for_multiple_measures, pivot_datafram...
None
assert
none_literal
src/boring_semantic_layer/chart/tests/test_utils.py
test_detect_time_dimension_from_dtype_no_datetime
TestDimensionUtils
109
null
boringdata/boring-semantic-layer
import json from pathlib import Path from unittest.mock import Mock, patch import pytest from returns.result import Failure, Success def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"carrier", "origin", "destination"} mock_model.measures = {"flight_count", "a...
result
assert
variable
src/boring_semantic_layer/agents/tests/test_tools.py
test_execute_unknown_tool
TestBSLToolsExecute
148
null
boringdata/boring-semantic-layer
from pathlib import Path from unittest.mock import patch from boring_semantic_layer.chart.md_parser.dashboard import ( _clean_label, _format_value, _generate_dashboard_html, _result_to_component, load_css_file, parse_frontmatter, BASE_CSS, DEFAULT_THEME_CSS, ) from boring_semantic_layer...
0
assert
numeric_literal
src/boring_semantic_layer/chart/md_parser/tests/test_dashboard.py
test_extract_single_block
TestMarkdownParser
35
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def test_join_dimension_matching_column_name(): """Test that joining on a dimension name that matches column name works.""" con = ibis.duckdb.connect(":memory:") # Both tables have column 'customer_id' c...
3
assert
numeric_literal
src/boring_semantic_layer/tests/test_dimension_validation.py
test_join_dimension_matching_column_name
337
null
boringdata/boring-semantic-layer
import ibis import pytest from boring_semantic_layer.api import to_semantic_table from boring_semantic_layer.query import Filter, query class TestDateFilterConversion: def orders_table(self): """Create orders table with date column.""" con = ibis.duckdb.connect(":memory:") return con.crea...
1
assert
numeric_literal
src/boring_semantic_layer/tests/test_date_filter_fix.py
test_combined_date_and_string_filters
TestDateFilterConversion
181
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
None
assert
none_literal
src/boring_semantic_layer/tests/test_chart.py
test_basic_bar_chart
TestAltairChart
62
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
parsed
assert
variable
src/boring_semantic_layer/chart/tests/test_chart.py
test_chart_json_format_plotly
TestChartFormats
304
null
boringdata/boring-semantic-layer
import pytest import pandas as pd from boring_semantic_layer.chart.echarts import ( EChartsBackend, EChartsChartType, EChartsOption, DEFAULT_COLOR_PALETTE, ) class TestEChartsBackend: def backend(self): """Create an EChartsBackend instance.""" return EChartsBackend() def samp...
base
assert
variable
src/boring_semantic_layer/chart/tests/test_echarts_backend.py
test_merge_options_none
TestEChartsBackend
428
null
boringdata/boring-semantic-layer
from pathlib import Path from unittest.mock import patch from boring_semantic_layer.chart.md_parser.dashboard import ( _clean_label, _format_value, _generate_dashboard_html, _result_to_component, load_css_file, parse_frontmatter, BASE_CSS, DEFAULT_THEME_CSS, ) from boring_semantic_layer...
3
assert
numeric_literal
src/boring_semantic_layer/chart/md_parser/tests/test_dashboard.py
test_consecutive_blocks_same_row
TestMarkdownParser
62
null
boringdata/boring-semantic-layer
import pytest import pandas as pd from boring_semantic_layer.chart.echarts import ( EChartsBackend, EChartsChartType, EChartsOption, DEFAULT_COLOR_PALETTE, ) class TestEChartsBackend: def backend(self): """Create an EChartsBackend instance.""" return EChartsBackend() def samp...
[]
assert
collection
src/boring_semantic_layer/chart/tests/test_echarts_backend.py
test_empty_data
TestEChartsBackend
518
null
boringdata/boring-semantic-layer
import json from unittest.mock import Mock, patch import pandas as pd import pytest from boring_semantic_layer.agents.utils.chart_handler import generate_chart_with_data def mock_query_result(): """Create a mock query result with execute() method.""" mock_result = Mock() df = pd.DataFrame({"origin": ["AT...
3
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_chart_handler.py
test_get_chart_false_returns_only_data_json_mode
35
null
boringdata/boring-semantic-layer
import ibis import json import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.Data...
0
assert
numeric_literal
src/boring_semantic_layer/chart/tests/test_echarts.py
test_basic_bar_chart
TestEChartsBasicCharts
78
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from returns.result import Failure, Success from boring_semantic_layer.utils import expr_to_ibis_string, ibis_string_to_expr from boring_semantic_layer.xorq_convert import ( from_tagged, serialize_dimensions, serialize_measures, to_tagged, try_impor...
{}
assert
collection
src/boring_semantic_layer/tests/test_xorq_convert.py
test_serialize_empty_dimensions
78
null
boringdata/boring-semantic-layer
import ibis from boring_semantic_layer.api import to_semantic_table from boring_semantic_layer.graph_utils import ( graph_bfs, graph_invert, graph_predecessors, graph_successors, graph_to_dict, ) def test_simple_dimension_dependencies(): """Test that dimensions track their column dependencies....
graph
assert
variable
src/boring_semantic_layer/tests/test_dependency_graph.py
test_simple_dimension_dependencies
30
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table class TestSessionization: def test_basic_sessionization_with_row_numbers(self): """Convert flat events into sessions with row numbering.""" con = ibis.duckdb.connect(":memory:") ...
5
assert
numeric_literal
src/boring_semantic_layer/tests/test_malloy_inspired.py
test_basic_sessionization_with_row_numbers
TestSessionization
127
null
boringdata/boring-semantic-layer
import ibis import pytest from ibis.expr.operations.relations import Aggregate from boring_semantic_layer.expr import SemanticModel from boring_semantic_layer.graph_utils import ( bfs, find_dimensions_and_measures, find_entity_dimensions, find_event_timestamp_dimensions, gen_children_of, replac...
{}
assert
collection
src/boring_semantic_layer/tests/test_graph_utils.py
test_find_dimensions_and_measures_no_semantic_table
61
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table def test_deferred_in_with_measures(): """Test using deferred expressions in with_measures().""" con = ibis.duckdb.connect(":memory:") flights = pd.DataFrame({"carrier": ["AA", "AA", "UA"], ...
3
assert
numeric_literal
src/boring_semantic_layer/tests/test_deferred_api.py
test_deferred_in_with_measures
30
null
boringdata/boring-semantic-layer
import contextlib import ibis import pytest from boring_semantic_layer import to_semantic_table, to_untagged pytestmark = pytest.mark.xfail( reason="Projection pushdown disabled for xorq vendored ibis compatibility" ) def wide_table(ibis_con): """Create a wide table with many unused columns.""" # Create...
0
assert
numeric_literal
src/boring_semantic_layer/tests/test_config_projection_pushdown.py
test_projection_pushdown_multiple_tables
TestProjectionPushdown
165
null
boringdata/boring-semantic-layer
import json from typing import Annotated, Any import ibis import pytest from pydantic import TypeAdapter, ValidationError from pydantic.functional_validators import BeforeValidator from boring_semantic_layer import MCPSemanticModel, to_semantic_table pytestmark = pytest.mark.anyio def anyio_backend(): return "a...
3
assert
numeric_literal
src/boring_semantic_layer/tests/test_mcp_json_parsing.py
test_claude_desktop_json_dimensions
TestJSONStringParsing
130
null
boringdata/boring-semantic-layer
from unittest.mock import Mock, patch import pytest pytest.importorskip("langchain", reason="langchain not installed") def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"category", "region"} mock_model.measures = {"count", "total"} mock_model.description ...
1
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_langgraph_backend.py
test_query_calls_on_tool_call_callback
TestLangGraphBackendQuery
169
null
boringdata/boring-semantic-layer
import ibis from boring_semantic_layer import to_semantic_table def test_to_semantic_table_without_description(): """Test that to_semantic_table works without description (backward compatibility).""" con = ibis.duckdb.connect(":memory:") data = ibis.memtable({"a": [1, 2, 3], "b": ["x", "y", "z"]}) tbl...
st.json_definition
assert
complex_expr
src/boring_semantic_layer/tests/test_description.py
test_to_semantic_table_without_description
33
null
boringdata/boring-semantic-layer
import json from unittest.mock import Mock, patch import pandas as pd import pytest from boring_semantic_layer.agents.utils.chart_handler import generate_chart_with_data def mock_query_result(): """Create a mock query result with execute() method.""" mock_result = Mock() df = pd.DataFrame({"origin": ["AT...
5
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_chart_handler.py
test_records_limit_cli_mode
153
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from boring_semantic_layer import SemanticModel from boring_semantic_layer.xorq_convert import from_tagged, to_tagged, try_import_xorq class TestXorqDuckDBBackend: def test_duckdb_filtered_query(self): """Test filtered query with xorq backend.""" ...
[3, 4, 5]
assert
collection
src/boring_semantic_layer/tests/test_xorq_backends.py
test_duckdb_filtered_query
TestXorqDuckDBBackend
102
null
boringdata/boring-semantic-layer
import pandas as pd import pytest from boring_semantic_layer.chart.utils import ( clean_field_name, convert_datetime_to_strings, detect_chart_type_generic, detect_time_dimension_from_dtype, get_non_time_dimensions, has_time_dimension, melt_dataframe_for_multiple_measures, pivot_datafram...
"date1"
assert
string_literal
src/boring_semantic_layer/chart/tests/test_utils.py
test_detect_time_dimension_from_dtype_first_match
TestDimensionUtils
121
null
boringdata/boring-semantic-layer
import json from pathlib import Path from unittest.mock import Mock, patch import pytest from returns.result import Failure, Success def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"carrier", "origin", "destination"} mock_model.measures = {"flight_count", "a...
True
assert
bool_literal
src/boring_semantic_layer/agents/tests/test_tools.py
test_query_model_all_params_combined
TestQueryModelExplicitParams
571
null
boringdata/boring-semantic-layer
from pathlib import Path from unittest.mock import patch from boring_semantic_layer.chart.md_parser.dashboard import ( _clean_label, _format_value, _generate_dashboard_html, _result_to_component, load_css_file, parse_frontmatter, BASE_CSS, DEFAULT_THEME_CSS, ) from boring_semantic_layer...
7
assert
numeric_literal
src/boring_semantic_layer/chart/md_parser/tests/test_dashboard.py
test_mixed_row_groups
TestMarkdownParser
109
null
boringdata/boring-semantic-layer
from pathlib import Path from unittest.mock import patch from boring_semantic_layer.chart.md_parser.dashboard import ( _clean_label, _format_value, _generate_dashboard_html, _result_to_component, load_css_file, parse_frontmatter, BASE_CSS, DEFAULT_THEME_CSS, ) from boring_semantic_layer...
"-"
assert
string_literal
src/boring_semantic_layer/chart/md_parser/tests/test_dashboard.py
test_format_value_none
TestFormatters
144
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def ecommerce_tables(con): """Create a realistic e-commerce schema with multiple tables.""" # Orders table ord...
2
assert
numeric_literal
src/boring_semantic_layer/tests/test_join_prefixing.py
test_conflicting_measure_names_both_accessible
TestBasicPrefixing
105
null
boringdata/boring-semantic-layer
import json import ibis import pandas as pd import pytest from fastmcp import Client from fastmcp.exceptions import ToolError from boring_semantic_layer import MCPSemanticModel, to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def sample_models(con):...
True
assert
bool_literal
src/boring_semantic_layer/agents/tests/test_semantic_mcp.py
test_get_model_with_time_dimension
TestGetModel
148
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from boring_semantic_layer import SemanticModel from boring_semantic_layer.xorq_convert import from_tagged, to_tagged, try_import_xorq class TestXorqIntegration: def test_metadata_preservation(self): """Test that BSL metadata is preserved through xorq tag...
"1.0"
assert
string_literal
src/boring_semantic_layer/tests/test_xorq_integration.py
test_metadata_preservation
TestXorqIntegration
144
null
boringdata/boring-semantic-layer
import json from unittest.mock import Mock, patch import pandas as pd import pytest from boring_semantic_layer.agents.utils.chart_handler import generate_chart_with_data def mock_query_result(): """Create a mock query result with execute() method.""" mock_result = Mock() df = pd.DataFrame({"origin": ["AT...
2
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_chart_handler.py
test_two_row_result_shows_chart
211
null
boringdata/boring-semantic-layer
import pytest import pandas as pd from boring_semantic_layer.chart.echarts import ( EChartsBackend, EChartsChartType, EChartsOption, DEFAULT_COLOR_PALETTE, ) class TestEChartsBackend: def backend(self): """Create an EChartsBackend instance.""" return EChartsBackend() def samp...
spec
assert
variable
src/boring_semantic_layer/chart/tests/test_echarts_backend.py
test_multi_series_legend
TestEChartsBackend
229
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from boring_semantic_layer import SemanticModel from boring_semantic_layer.xorq_convert import from_tagged, to_tagged, try_import_xorq class TestXorqIntegration: def test_xorq_expression_execution(self): """Test that converted xorq expression can be execu...
df.columns
assert
complex_expr
src/boring_semantic_layer/tests/test_xorq_integration.py
test_xorq_expression_execution
TestXorqIntegration
73
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from returns.result import Failure, Success from boring_semantic_layer.utils import expr_to_ibis_string, ibis_string_to_expr from boring_semantic_layer.xorq_convert import ( from_tagged, serialize_dimensions, serialize_measures, to_tagged, try_impor...
data["total"]
assert
complex_expr
src/boring_semantic_layer/tests/test_xorq_convert.py
test_serialize_measures_with_metadata
145
null
boringdata/boring-semantic-layer
from __future__ import annotations from ibis import _ from returns.result import Failure, Success from boring_semantic_layer.utils import ( _is_url, expr_to_ibis_string, ibis_string_to_expr, safe_eval, ) def test_safe_list_operations(): result = safe_eval("[1, 2, 3]") assert isinstance(result...
[1, 2, 3]
assert
collection
src/boring_semantic_layer/tests/test_utils.py
test_safe_list_operations
116
null
boringdata/boring-semantic-layer
import json from typing import Annotated, Any import ibis import pytest from pydantic import TypeAdapter, ValidationError from pydantic.functional_validators import BeforeValidator from boring_semantic_layer import MCPSemanticModel, to_semantic_table pytestmark = pytest.mark.anyio def anyio_backend(): return "a...
items
assert
variable
src/boring_semantic_layer/agents/tests/test_mcp_json_parsing.py
test_order_by_has_items_in_schema
TestSchemaGeneration
209
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """Create an in-memory DuckDB connection.""" return ibis.duckdb.connect(":memory:") def flights(con): """Create a sample flights table for testing.""" df = pd.DataFrame( { ...
1
assert
numeric_literal
src/boring_semantic_layer/tests/test_filter_with_dimensions.py
test_filter_then_with_measures
81
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table class TestConvergentPathTrap: def models(self): con = ibis.duckdb.connect(":memory:") airports_tbl = con.create_table( "airports", pd.DataFrame( ...
4
assert
numeric_literal
src/boring_semantic_layer/tests/test_bi_traps.py
test_convergent_path_duplicate_rows
TestConvergentPathTrap
548
null
boringdata/boring-semantic-layer
import json from typing import Annotated, Any import ibis import pytest from pydantic import TypeAdapter, ValidationError from pydantic.functional_validators import BeforeValidator from boring_semantic_layer import MCPSemanticModel, to_semantic_table pytestmark = pytest.mark.anyio def anyio_backend(): return "a...
record
assert
variable
src/boring_semantic_layer/agents/tests/test_mcp_json_parsing.py
test_end_to_end_claude_desktop_query
TestIntegration
366
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from boring_semantic_layer.xorq_convert import from_tagged, to_tagged, try_import_xorq class TestMalloyModelsRoundTrip: def test_multiple_measures_roundtrip(self): """Test model with multiple calculated measures.""" import ibis import pand...
3
assert
numeric_literal
src/boring_semantic_layer/tests/test_malloy_xorq_roundtrip.py
test_multiple_measures_roundtrip
TestMalloyModelsRoundTrip
385
null
MasoniteFramework/masonite
from tests import TestCase from src.masonite.utils.str import ( random_string, removeprefix, removesuffix, get_controller_name, add_query_params, ) from tests.integrations.controllers.api.TestController import TestController class TestStringsUtils(TestCase): def test_add_query_params_not_bre...
add_query_params(url, {}))
self.assertEqual
func_call
tests/core/utils/test_str.py
test_add_query_params_not_break_urls
TestStringsUtils
48
null
MasoniteFramework/masonite
from tests import TestCase from masoniteorm.models import Model from src.masonite.authorization import Authorizes from src.masonite.facades import Gate class TestAuthorizes(TestCase): def setUp(self): super().setUp() self.make_request() def test_user_can(self): user = User.find(1) ...
user.can("create-post"))
self.assertTrue
func_call
tests/core/authorization/test_authorizes.py
test_user_can
TestAuthorizes
22
null
MasoniteFramework/masonite
from tests import TestCase import os import time import pytest class TestRedisCache(TestCase): def setUp(self): super().setUp() self.application.make("cache") self.driver = self.application.make("cache").store("redis") def test_can_get_driver(self): self.driver.put("key", "valu...
self.driver.has("key"))
self.assertTrue
func_call
tests/features/cache/test_redis_cache.py
test_can_get_driver
TestRedisCache
20
null
MasoniteFramework/masonite
from tests import TestCase import os import time class TestFileCache(TestCase): def setUp(self): super().setUp() self.application.make("cache") self.driver = self.application.make("cache").store() def test_can_increment(self): self.driver.put("count", "1") self.assertEq...
"2")
self.assertEqual
string_literal
tests/features/cache/test_file_cache.py
test_can_increment
TestFileCache
24
null
MasoniteFramework/masonite
from unittest.mock import MagicMock from src.masonite.middleware import MiddlewareCapsule from tests import TestCase class TestMiddleware(TestCase): def test_can_use_request_inputs_as_args(self): # this create a request with @user_id and @id as in input request = self.make_request(query_string="u...
"1")
assert_*
string_literal
tests/core/middleware/test_middleware.py
test_can_use_request_inputs_as_args
TestMiddleware
85
null
MasoniteFramework/masonite
from tests import TestCase from src.masonite.facades import Config from src.masonite.configuration import config from src.masonite.exceptions import InvalidConfigurationSetup PACKAGE_PARAM = 1 OTHER_PARAM = 3 class TestConfiguration(TestCase): def test_config_is_loaded(self): self.assertGreater(len(Confi...
0)
self.assertGreater
numeric_literal
tests/core/configuration/test_config.py
test_config_is_loaded
TestConfiguration
13
null
MasoniteFramework/masonite
import unittest from src.masonite.validation import MessageBag class TestMessageBag(unittest.TestCase): def setUp(self): self.errors = MessageBag.view_helper( {"email": ["email is required", "email must be a valid email"]} ) def test_get_errors(self): self.assertTrue(
self.errors.any())
self.assertTrue
func_call
tests/features/validation/test_messagebag_view.py
test_get_errors
TestMessageBag
12
null
MasoniteFramework/masonite
from tests import TestCase import os import time import pytest class TestMemcacheCache(TestCase): def setUp(self): super().setUp() self.application.make("cache") self.driver = self.application.make("cache").store("memcache") def test_can_get_driver(self): self.driver.put("key",...
self.driver.has("key"))
self.assertTrue
func_call
tests/features/cache/test_memcache_cache.py
test_can_get_driver
TestMemcacheCache
20
null
MasoniteFramework/masonite
from src.masonite.middleware.route.IpMiddleware import IpMiddleware from tests import TestCase from src.masonite.request import Request from src.masonite.utils.http import generate_wsgi class TestRequest(TestCase): def test_is_ajax(self): request = self.make_request({"HTTP_X_REQUESTED_WITH": "XMLHttpReque...
non_ajax_request.is_ajax())
self.assertFalse
func_call
tests/core/request/test_request.py
test_is_ajax
TestRequest
66
null
MasoniteFramework/masonite
import pendulum from masoniteorm.models import Model from tests import TestCase from src.masonite.tests import DatabaseTransactions from src.masonite.notification import Notification, Notifiable from src.masonite.notification import DatabaseNotification class TestDatabaseDriver(TestCase, DatabaseTransactions): c...
user.id
assert
complex_expr
tests/features/notification/test_database_driver.py
test_database_notification_is_created_correctly
TestDatabaseDriver
54
null
MasoniteFramework/masonite
from tests import TestCase from masoniteorm.models import Model from src.masonite.exceptions.exceptions import AuthorizationException, GateDoesNotExist from src.masonite.authorization import AuthorizationResponse from src.masonite.routes import Route class TestGate(TestCase): def setUp(self): super().setU...
self.gate.has("view-user"))
self.assertFalse
func_call
tests/core/authorization/test_gate.py
test_gate_has_permission
TestGate
102
null
MasoniteFramework/masonite
from tests import TestCase from src.masonite.utils.str import ( random_string, removeprefix, removesuffix, get_controller_name, add_query_params, ) from tests.integrations.controllers.api.TestController import TestController class TestStringsUtils(TestCase): def test_removesuffix(self): ...
"test")
self.assertEqual
string_literal
tests/core/utils/test_str.py
test_removesuffix
TestStringsUtils
22
null
MasoniteFramework/masonite
from tests import TestCase import os import time from src.masonite.filesystem import File from src.masonite.utils.filesystem import mimetypes class TestLocalStorage(TestCase): def setUp(self): super().setUp() self.application.make("storage") self.driver = self.application.make("storage").di...
".log")
self.assertEqual
string_literal
tests/features/storage/test_local_storage.py
test_can_stream
TestLocalStorage
26
null
MasoniteFramework/masonite
from tests import TestCase from src.masonite.loader.Loader import Loader from src.masonite.exceptions import LoaderNotFound OBJ_1 = "test" class TestLoader(TestCase): def setUp(self): super().setUp() self.loader = Loader() def test_get_objects_for_unexisting_path(self): objects = sel...
objects)
self.assertIsNone
variable
tests/features/loader/test_loader.py
test_get_objects_for_unexisting_path
TestLoader
22
null
MasoniteFramework/masonite
from src.masonite.middleware.route.IpMiddleware import IpMiddleware from tests import TestCase from src.masonite.request import Request from src.masonite.utils.http import generate_wsgi class TestRequest(TestCase): def test_request_contains(self): request = Request(generate_wsgi(path="/test")) se...
request.contains("/test"))
self.assertTrue
func_call
tests/core/request/test_request.py
test_request_contains
TestRequest
15
null
MasoniteFramework/masonite
import pendulum from tests import TestCase from src.masonite.facades import RateLimiter, Cache def my_function(): return "done" class TestRateLimiter(TestCase): def tearDown(self): super().tearDown() # delete cache entries between tests for idempotent tests self.application.make("cach...
"1"
assert
string_literal
tests/features/rates/test_rate_limiter.py
test_reset_attempts
TestRateLimiter
34
null
MasoniteFramework/masonite
from typing import TYPE_CHECKING from tests import TestCase from tests.integrations.app.SayHi import SayHello from tests.integrations.app.GreetingService import GreetingService from tests.integrations.app.User import User from src.masonite.exceptions import ( StrictContainerException, MissingContainerBindingNo...
User)
self.assertIsInstance
variable
tests/core/foundation/test_container.py
test_container_can_resolve_nested_class_dependencies_without_binding
TestContainer
104
null
MasoniteFramework/masonite
from tests import TestCase from src.masonite.utils.http import generate_wsgi from src.masonite.request import Request class TestRequest(TestCase): def setUp(self): super().setUp() self.request = Request(generate_wsgi(path="/test")) def test_request_can_get_list_value(self): self.reque...
["foo", "bar"])
self.assertEqual
collection
tests/core/request/test_request_input.py
test_request_can_get_list_value
TestRequest
21
null
MasoniteFramework/masonite
import sys from tests import TestCase from src.masonite.rates import UnlimitedLimiter, GlobalLimiter, Limit, GuestsOnlyLimiter from tests.integrations.app.User import User class TestLimits(TestCase): def test_limit_per_minute(self): limit = Limit.per_minute(5) assert limit.max_attempts == 5 ...
1
assert
numeric_literal
tests/features/rates/test_limits.py
test_limit_per_minute
TestLimits
17
null
MasoniteFramework/masonite
from src.masonite.utils.http import HTTP_STATUS_CODES from tests import TestCase from src.masonite.exceptions.exceptions import MethodNotAllowedException from src.masonite.routes import Route, Router class TestRoutes(TestCase): def setUp(self): super().setUp() Route.set_controller_locations("tests...
"")
self.assertEqual
string_literal
tests/routes/test_routes.py
test_options_method_returns_allowed_methods
TestRoutes
332
null
MasoniteFramework/masonite
import unittest from src.masonite.validation import MessageBag class TestMessageBag(unittest.TestCase): def setUp(self): self.bag = MessageBag() def test_get_errors(self): self.bag.reset() self.bag.add("email", "Your email is invalid") self.bag.add("email", "Your email too shor...
["email"])
self.assertEqual
collection
tests/features/validation/test_messagebag.py
test_get_errors
TestMessageBag
74
null
MasoniteFramework/masonite
from tests import TestCase from src.masonite.helpers import optional class TestOptionalHelper(TestCase): def test_optional_with_existing(self): obj = SomeClass() assert optional(obj).my_attr ==
3
assert
numeric_literal
tests/core/helpers/test_optional.py
test_optional_with_existing
TestOptionalHelper
17
null
MasoniteFramework/masonite
from tests import TestCase from src.masonite.utils.http import generate_wsgi from src.masonite.request import Request class TestRequest(TestCase): def setUp(self): super().setUp() self.request = Request(generate_wsgi(path="/test")) def test_request_can_get_nested_value_from_query_string(self)...
1)
self.assertEqual
numeric_literal
tests/core/request/test_request_input.py
test_request_can_get_nested_value_from_query_string
TestRequest
29
null
MasoniteFramework/masonite
import json from ..views import View from ..controllers import Controller from ..utils.structures import data_get class HttpTestResponse: def __init__(self, testcase, application, request, response, route): self.testcase = testcase self.application = application self.request = request ...
-1
assert
numeric_literal
src/masonite/tests/HttpTestResponse.py
assertContainsInOrder
HttpTestResponse
46
null
MasoniteFramework/masonite
import pendulum from tests import TestCase from src.masonite.facades import RateLimiter, Cache def my_function(): return "done" class TestRateLimiter(TestCase): def tearDown(self): super().tearDown() # delete cache entries between tests for idempotent tests self.application.make("cach...
"0"
assert
string_literal
tests/features/rates/test_rate_limiter.py
test_reset_attempts
TestRateLimiter
36
null
MasoniteFramework/masonite
import sys from tests import TestCase from src.masonite.rates import UnlimitedLimiter, GlobalLimiter, Limit, GuestsOnlyLimiter from tests.integrations.app.User import User class TestLimiters(TestCase): def test_global(self): request = "fake" limiter = GlobalLimiter("3/minute") limit = lim...
3
assert
numeric_literal
tests/features/rates/test_limits.py
test_global
TestLimiters
53
null
MasoniteFramework/masonite
from unittest import TestCase from src.masonite.routes import Route from tests.integrations.controllers.WelcomeController import WelcomeController class TestParsingControllerInRoutes(TestCase): def setUp(self): Route.set_controller_locations("tests.integrations.controllers") pass def test_use...
"hello"
assert
string_literal
tests/routes/test_parsing_controllers.py
test_use_controller_class_without_method
TestParsingControllerInRoutes
42
null
MasoniteFramework/masonite
from src.masonite.middleware.route.IpMiddleware import IpMiddleware from tests import TestCase from src.masonite.request import Request from src.masonite.utils.http import generate_wsgi class TestRequest(TestCase): def test_request_can_get_path(self): request = Request(generate_wsgi(path="/test")) ...
"/test")
self.assertEqual
string_literal
tests/core/request/test_request.py
test_request_can_get_path
TestRequest
10
null
MasoniteFramework/masonite
from tests import TestCase from src.masonite.pipeline import Pipeline from src.masonite.request import Request import os class TestPipeline(TestCase): def test_pipeline_sets_attributes(self): request = Request({}) request2 = Request({}) pipeline = Pipeline(request, request2).through([PipeTe...
request.one == 1)
self.assertTrue
complex_expr
tests/pipeline/test_pipeline.py
test_pipeline_sets_attributes
TestPipeline
39
null
MasoniteFramework/masonite
from tests import TestCase from src.masonite.utils.http import generate_wsgi from src.masonite.request import Request class TestRequest(TestCase): def setUp(self): super().setUp() self.request = Request(generate_wsgi(path="/test")) def test_request_can_get_nested_value_from_post_data_using_wi...
[1,6])
self.assertEqual
collection
tests/core/request/test_request_input.py
test_request_can_get_nested_value_from_post_data_using_wildcard
TestRequest
37
null
MasoniteFramework/masonite
import pendulum import os import pytest import sys from tests import TestCase from tests.integrations.controllers.WelcomeController import WelcomeController from masoniteorm.models import Model from src.masonite.routes import Route from src.masonite.authentication import Authenticates from src.masonite.middleware impo...
0
assert
numeric_literal
tests/tests/test_testcase.py
test_with_headers
TestTestingAssertions
202
null
MasoniteFramework/masonite
from tests import TestCase from src.masonite.facades import Dump from src.masonite.exceptions import DumpException class TestDumper(TestCase): def setUp(self): super().setUp() self.dumper = self.application.make("dumper") def tearDown(self): super().tearDown() self.dumper.clea...
"1"
assert
string_literal
tests/features/dumps/test_dumper.py
test_serialize_dump
TestDumper
53
null
MasoniteFramework/masonite
from tests import TestCase import os import time import pytest class TestMemcacheCache(TestCase): def setUp(self): super().setUp() self.application.make("cache") self.driver = self.application.make("cache").store("memcache") def test_flush(self): self.driver.remember( ...
self.driver.get("dic"))
self.assertIsNone
func_call
tests/features/cache/test_memcache_cache.py
test_flush
TestMemcacheCache
63
null
MasoniteFramework/masonite
from tests import TestCase from src.masonite.mail import Mailable from src.masonite.mail.Recipient import Recipient class TestMailable(TestCase): def setUp(self): super().setUp() self.application.make("mail") def test_build_mail(self): mailable = Welcome().build().get_options() ...
"smtp")
self.assertEqual
string_literal
tests/features/mail/test_mailable.py
test_build_mail
TestMailable
40
null