repo_id stringclasses 400
values | commit_sha stringclasses 400
values | commit_index int32 0 951 | in_repo_split stringclasses 1
value | cross_repo_split stringclasses 1
value | test_file stringlengths 7 121 | test_function stringlengths 1 108 | assertion_type stringclasses 32
values | difficulty stringclasses 8
values | context_lines int32 3 600 | prefix large_stringlengths 44 113k | target large_stringlengths 1 498 | anchor_sha stringclasses 400
values | anchor_index int32 0 951 | qna_source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | examples/src/routing__RouterMixin__page__test.py | test_page_routes | assert | string_literal | 11 | from fastapi.testclient import TestClient
from .routing__RouterMixin__page import app
def test_page_routes() -> None:
client = TestClient(app)
response = client.get("/")
assert response.status_code == 200
assert response.headers["content-type"] == | "text/html; charset=utf-8" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/benchmarks/test_memory_tag_cleanup.py | test_nested_tag_memory_efficiency | assert | numeric_literal | 66 | import gc
import logging
import tracemalloc
import pytest
import air
from air import Div, Span
logging.basicConfig(level=logging.INFO, format="%(message)s")
@pytest.mark.memory
def test_nested_tag_memory_efficiency() -> None:
"""Test memory usage patterns for deeply nested tag structures.
Verifies that com... | 0.8 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/benchmarks/test_memory_tag_cleanup.py | test_tag_creation_memory_scaling | assert | numeric_literal | 79 | import gc
import logging
import tracemalloc
import pytest
import air
from air import Div, Span
logging.basicConfig(level=logging.INFO, format="%(message)s")
@pytest.mark.memory
def test_tag_creation_memory_scaling() -> None:
"""Test that tag creation memory usage scales linearly with object count.
Ensures ... | 1.5 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/benchmarks/test_memory_tag_cleanup.py | test_tag_creation_memory_scaling | assert | numeric_literal | 84 | import gc
import logging
import tracemalloc
import pytest
import air
from air import Div, Span
logging.basicConfig(level=logging.INFO, format="%(message)s")
@pytest.mark.memory
def test_tag_creation_memory_scaling() -> None:
"""Test that tag creation memory usage scales linearly with object count.
Ensures ... | 2048 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/benchmarks/test_memory_tag_cleanup.py | test_nested_tag_memory_efficiency | assert | complex_expr | 69 | import gc
import logging
import tracemalloc
import pytest
import air
from air import Div, Span
logging.basicConfig(level=logging.INFO, format="%(message)s")
@pytest.mark.memory
def test_nested_tag_memory_efficiency() -> None:
"""Test memory usage patterns for deeply nested tag structures.
Verifies that com... | 512 * 1024 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/benchmarks/test_memory_tag_cleanup.py | test_tag_object_memory_cleanup | assert | variable | 71 | import gc
import logging
import tracemalloc
import pytest
import air
from air import Div, Span
logging.basicConfig(level=logging.INFO, format="%(message)s")
@pytest.mark.memory
def test_tag_object_memory_cleanup() -> None:
"""Verify that creating and destroying many tag objects doesn't leak memory.
This te... | max_allowed_growth | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/scripts/test_copy_src_example_to_callable.py | test_parse_filename_class_returns_none_for_test_files | assert | none_literal | 22 | from pathlib import Path
import pytest
from pytest import CaptureFixture
from scripts.copy_src_example_to_callable import (
main,
parse_filename_class,
update_example_section,
)
def project_dirs(tmp_path: Path) -> tuple[Path, Path, Path]:
"""Create the standard project directory structure for testing ... | None | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/scripts/test_copy_src_example_to_callable.py | test_update_example_section_updates_function_docstring | assert | bool_literal | 33 | from pathlib import Path
import pytest
from pytest import CaptureFixture
from scripts.copy_src_example_to_callable import (
main,
parse_filename_class,
update_example_section,
)
def project_dirs(tmp_path: Path) -> tuple[Path, Path, Path]:
"""Create the standard project directory structure for testing ... | True | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/scripts/test_copy_src_example_to_callable.py | test_update_example_section_returns_false_for_missing_example_section | assert | bool_literal | 31 | from pathlib import Path
import pytest
from pytest import CaptureFixture
from scripts.copy_src_example_to_callable import (
main,
parse_filename_class,
update_example_section,
)
def project_dirs(tmp_path: Path) -> tuple[Path, Path, Path]:
"""Create the standard project directory structure for testing ... | False | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/scripts/test_copy_src_example_to_callable.py | test_update_example_section_returns_false_for_missing_example_section | assert | complex_expr | 34 | from pathlib import Path
import pytest
from pytest import CaptureFixture
from scripts.copy_src_example_to_callable import (
main,
parse_filename_class,
update_example_section,
)
def project_dirs(tmp_path: Path) -> tuple[Path, Path, Path]:
"""Create the standard project directory structure for testing ... | captured.out | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/scripts/test_missing_examples.py | test_extract_callables_from_file_handles_syntax_error | assert | numeric_literal | 33 | import json
from collections import defaultdict
from pathlib import Path
import pytest
from pytest import CaptureFixture
from scripts.missing_examples import (
check_docstring_for_example,
extract_callables_from_file,
main,
)
def project_dirs(tmp_path: Path) -> tuple[Path, Path]:
"""Create the standar... | 0 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/scripts/test_missing_examples.py | test_main_check_mode_fails_with_new_missing | assert | numeric_literal | 48 | import json
from collections import defaultdict
from pathlib import Path
import pytest
from pytest import CaptureFixture
from scripts.missing_examples import (
check_docstring_for_example,
extract_callables_from_file,
main,
)
def project_dirs(tmp_path: Path) -> tuple[Path, Path]:
"""Create the standar... | 1 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/scripts/test_missing_examples.py | test_check_docstring_for_example | assert | bool_literal | 21 | import json
from collections import defaultdict
from pathlib import Path
import pytest
from pytest import CaptureFixture
from scripts.missing_examples import (
check_docstring_for_example,
extract_callables_from_file,
main,
)
def project_dirs(tmp_path: Path) -> tuple[Path, Path]:
"""Create the standar... | True | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/scripts/test_missing_examples.py | test_check_docstring_for_example | assert | bool_literal | 22 | import json
from collections import defaultdict
from pathlib import Path
import pytest
from pytest import CaptureFixture
from scripts.missing_examples import (
check_docstring_for_example,
extract_callables_from_file,
main,
)
def project_dirs(tmp_path: Path) -> tuple[Path, Path]:
"""Create the standar... | False | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/scripts/test_missing_examples.py | test_extract_callables_from_file | assert | variable | 62 | import json
from collections import defaultdict
from pathlib import Path
import pytest
from pytest import CaptureFixture
from scripts.missing_examples import (
check_docstring_for_example,
extract_callables_from_file,
main,
)
def project_dirs(tmp_path: Path) -> tuple[Path, Path]:
"""Create the standar... | results | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/scripts/test_missing_examples.py | test_main_baseline_mode_creates_file | assert | variable | 43 | import json
from collections import defaultdict
from pathlib import Path
import pytest
from pytest import CaptureFixture
from scripts.missing_examples import (
check_docstring_for_example,
extract_callables_from_file,
main,
)
def project_dirs(tmp_path: Path) -> tuple[Path, Path]:
"""Create the standar... | baseline | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_applications.py | test_air_app_factory | assert | numeric_literal | 20 | from fastapi import FastAPI
from fastapi.testclient import TestClient
from starlette.requests import Request
import air
from air.exception_handlers import DEFAULT_EXCEPTION_HANDLERS, default_500_exception_handler
def test_air_app_factory() -> None:
app = air.Air()
# @app.get("/test", response_class=AirRespon... | 200 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_applications.py | test_air_404_response | assert | numeric_literal | 15 | from fastapi import FastAPI
from fastapi.testclient import TestClient
from starlette.requests import Request
import air
from air.exception_handlers import DEFAULT_EXCEPTION_HANDLERS, default_500_exception_handler
def test_air_404_response() -> None:
app = air.Air()
client = TestClient(app)
response = cli... | 404 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_applications.py | test_default_500_exception_handler | assert | numeric_literal | 25 | from fastapi import FastAPI
from fastapi.testclient import TestClient
from starlette.requests import Request
import air
from air.exception_handlers import DEFAULT_EXCEPTION_HANDLERS, default_500_exception_handler
def test_default_500_exception_handler() -> None:
# Create a mock request and exception
scope = {... | 500 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_applications.py | test_injection_of_default_exception_handlers | assert | variable | 22 | from fastapi import FastAPI
from fastapi.testclient import TestClient
from starlette.requests import Request
import air
from air.exception_handlers import DEFAULT_EXCEPTION_HANDLERS, default_500_exception_handler
def test_injection_of_default_exception_handlers() -> None:
def handler(request: air.Request, exc: Ex... | handler | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_applications.py | test_url_helper_method | assert | string_literal | 22 | from fastapi import FastAPI
from fastapi.testclient import TestClient
from starlette.requests import Request
import air
from air.exception_handlers import DEFAULT_EXCEPTION_HANDLERS, default_500_exception_handler
def test_url_helper_method() -> None:
"""Test that route decorators have .url() method for URL genera... | "/about" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_applications.py | test_air_plus_fastapi | assert | string_literal | 33 | from fastapi import FastAPI
from fastapi.testclient import TestClient
from starlette.requests import Request
import air
from air.exception_handlers import DEFAULT_EXCEPTION_HANDLERS, default_500_exception_handler
def test_air_plus_fastapi() -> None:
app = FastAPI()
html = air.Air()
@app.get("/api")
d... | "application/json" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_applications.py | test_page_decorator | assert | string_literal | 25 | from fastapi import FastAPI
from fastapi.testclient import TestClient
from starlette.requests import Request
import air
from air.exception_handlers import DEFAULT_EXCEPTION_HANDLERS, default_500_exception_handler
def test_page_decorator() -> None:
app = air.Air()
page = app.page
@page
def index() -> ... | "<h1>Home page</h1>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_applications.py | test_page_decorator | assert | string_literal | 30 | from fastapi import FastAPI
from fastapi.testclient import TestClient
from starlette.requests import Request
import air
from air.exception_handlers import DEFAULT_EXCEPTION_HANDLERS, default_500_exception_handler
def test_page_decorator() -> None:
app = air.Air()
page = app.page
@page
def index() -> ... | "<h1>About page</h1>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_applications.py | test_url_helper_method | assert | string_literal | 21 | from fastapi import FastAPI
from fastapi.testclient import TestClient
from starlette.requests import Request
import air
from air.exception_handlers import DEFAULT_EXCEPTION_HANDLERS, default_500_exception_handler
def test_url_helper_method() -> None:
"""Test that route decorators have .url() method for URL genera... | "/users/123/posts/456" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_background.py | test_background_task_in_view | assert | numeric_literal | 11 | from fastapi.testclient import TestClient
import air
def test_background_task_in_view() -> None:
app = air.Air()
elements = []
assert len(elements) == | 0 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_background.py | test_background_task_in_view | assert | numeric_literal | 25 | from fastapi.testclient import TestClient
import air
def test_background_task_in_view() -> None:
app = air.Air()
elements = []
assert len(elements) == 0
def creeping_task() -> None:
elements.append(1)
@app.get("/big-process")
async def test_big_process(background_tasks: air.Backgro... | 1 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_background.py | test_background_task_in_view | assert | numeric_literal | 24 | from fastapi.testclient import TestClient
import air
def test_background_task_in_view() -> None:
app = air.Air()
elements = []
assert len(elements) == 0
def creeping_task() -> None:
elements.append(1)
@app.get("/big-process")
async def test_big_process(background_tasks: air.Backgro... | 200 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_counts_return_lengths | assert | numeric_literal | 40 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | 2 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_compact_format_html_minifies | assert | numeric_literal | 37 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | 760 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_compact_format_html_minifies | assert | numeric_literal | 38 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | 7530 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_compact_format_html_minifies | assert | numeric_literal | 39 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | 883215 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_last_child_returns_last_child | assert | string_literal | 39 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | "last" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_full_repr_includes_attributes_and_children | assert | variable | 43 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | result | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_to_json_and_to_pretty_json_round_trip | assert | variable | 43 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | loaded | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_first_child_returns_first_child | assert | string_literal | 39 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | "alpha" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_to_dict_and_to_child_dict_structure | assert | string_literal | 46 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | "plain" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_render_and_str_return_paired_markup | assert | variable | 40 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | expected | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_pretty_render_passes_flags_to_formatter | assert | string_literal | 47 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | "pretty" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_compact_render_passes_html_to_compact_formatter | assert | string_literal | 47 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | "minified" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_pretty_display_in_the_browser_delegates | assert | collection | 50 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | ["pretty"] | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_base_tag.py | test_basetag_cannot_be_instantiated_directly | pytest.raises | variable | 37 | from __future__ import annotations
import ast
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import (
AIR_TAG_SAMPLE,
FRAGMENT_AIR_TAG_SAMPLE,
SMALL_AIR_TAG_SAMPLE,
TINY_AIR_TAG_SAMPLE,
)
from example... | TypeError) | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_init_signature_compat | assert | numeric_literal | 12 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
def test_init_signature_compat() -> None:
e = air.HTTPException(status_code=418, detail="teapot", headers={"X-Foo": "Bar"})
assert e.status_code... | 418 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_fastapi_integration_404 | assert | numeric_literal | 19 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
def test_fastapi_integration_404() -> None:
app = air.Air()
@app.get("/")
def boom() -> NoReturn:
raise air.HTTPException(status_cod... | 404 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_headers_passthrough | assert | numeric_literal | 23 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
def test_headers_passthrough() -> None:
app = air.Air()
@app.get("/with-headers")
def with_headers() -> NoReturn:
raise air.HTTPExce... | 429 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_headers_passthrough | assert | string_literal | 24 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
def test_headers_passthrough() -> None:
app = air.Air()
@app.get("/with-headers")
def with_headers() -> NoReturn:
raise air.HTTPExce... | "5" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_custom_exception_handler_compat | assert | numeric_literal | 23 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
def test_custom_exception_handler_compat() -> None:
app = air.Air()
@app.exception_handler(FastAPIHTTPException)
async def custom_http_excep... | 403 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_headers_passthrough | assert | string_literal | 25 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
def test_headers_passthrough() -> None:
app = air.Air()
@app.get("/with-headers")
def with_headers() -> NoReturn:
raise air.HTTPExce... | "Bar" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_fastapi_integration_various_details | assert | variable | 27 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
@pytest.mark.parametrize(
"status,detail",
[
(400, "bad request"),
(401, {"msg": "unauthorized", "code": "UNAUTH"}),
(422... | status | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_fastapi_integration_various_details | assert | variable | 28 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
@pytest.mark.parametrize(
"status,detail",
[
(400, "bad request"),
(401, {"msg": "unauthorized", "code": "UNAUTH"}),
(422... | detail | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_fastapi_integration_404 | assert | complex_expr | 20 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
def test_fastapi_integration_404() -> None:
app = air.Air()
@app.get("/")
def boom() -> NoReturn:
raise air.HTTPException(status_cod... | r.text | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_init_signature_compat | assert | string_literal | 13 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
def test_init_signature_compat() -> None:
e = air.HTTPException(status_code=418, detail="teapot", headers={"X-Foo": "Bar"})
assert e.status_code ... | "teapot" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_custom_exception_handler_compat | assert | string_literal | 24 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
def test_custom_exception_handler_compat() -> None:
app = air.Air()
@app.exception_handler(FastAPIHTTPException)
async def custom_http_excep... | "oops:403:nope" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_exceptions.py | test_headers_passthrough | assert | collection | 26 | from typing import NoReturn
import pytest
from fastapi.exceptions import HTTPException as FastAPIHTTPException
from fastapi.testclient import TestClient
import air
def test_headers_passthrough() -> None:
app = air.Air()
@app.get("/with-headers")
def with_headers() -> NoReturn:
raise air.HTTPExce... | {"detail": "too many requests"} | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_forms.py | test_html5_validation_attributes | assert | numeric_literal | 33 | from collections.abc import Sequence
from typing import Annotated, cast
import annotated_types
import pytest
from fastapi import Depends, Request
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
import air
def test_html5_validation_attributes() -> None:
"""Test that HTML5 validatio... | 3 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_forms.py | test_html5_validation_with_standard_field | assert | numeric_literal | 28 | from collections.abc import Sequence
from typing import Annotated, cast
import annotated_types
import pytest
from fastapi import Depends, Request
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
import air
def test_html5_validation_with_standard_field() -> None:
"""Test HTML5 valid... | 2 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_forms.py | test_air_field_with_default_value | assert | numeric_literal | 23 | from collections.abc import Sequence
from typing import Annotated, cast
import annotated_types
import pytest
from fastapi import Depends, Request
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
import air
def test_air_field_with_default_value() -> None:
"""Test AirField with defau... | 25 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_forms.py | test_form_validation_dependency_injection | assert | numeric_literal | 37 | from collections.abc import Sequence
from typing import Annotated, cast
import annotated_types
import pytest
from fastapi import Depends, Request
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
import air
def test_form_validation_dependency_injection() -> None:
class CheeseModel(B... | 200 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_forms.py | test_form_render_with_errors | assert | variable | 25 | from collections.abc import Sequence
from typing import Annotated, cast
import annotated_types
import pytest
from fastapi import Depends, Request
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
import air
def test_form_render_with_errors() -> None:
class CheeseModel(BaseModel):
... | html | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_html_utils.py | test_format_html_all_parameter_combinations | assert | variable | 65 | from __future__ import annotations
import pytest
from lxml.etree import ParserError
from air.tags.constants import HTML_DOCTYPE
from air.tags.utils import (
format_html,
pretty_format_html,
)
def _expected_format_html_fragment(*, pretty: bool, with_doctype: bool) -> str:
base: str = "<p>Hi</p>\n" if pre... | expected | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_html_utils.py | test_format_html_empty_raises_parser_error | pytest.raises | variable | 44 | from __future__ import annotations
import pytest
from lxml.etree import ParserError
from air.tags.constants import HTML_DOCTYPE
from air.tags.utils import (
format_html,
pretty_format_html,
)
def _expected_format_html_fragment(*, pretty: bool, with_doctype: bool) -> str:
base: str = "<p>Hi</p>\n" if pre... | ParserError) | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_html_utils.py | test_format_html_empty_raises_parser_error | assert | string_literal | 46 | from __future__ import annotations
import pytest
from lxml.etree import ParserError
from air.tags.constants import HTML_DOCTYPE
from air.tags.utils import (
format_html,
pretty_format_html,
)
def _expected_format_html_fragment(*, pretty: bool, with_doctype: bool) -> str:
base: str = "<p>Hi</p>\n" if pre... | "ParserError" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_layouts.py | test_pico_layout | assert | variable | 26 | import air
from .utils import clean_doc, clean_doc_with_broken_lines
def test_pico_layout() -> None:
actual_html = air.layouts.picocss(air.H1("Cheese Monger"), air.Title("Cheese Monger")).pretty_render()
expected_html = clean_doc_with_broken_lines(
r"""
<!doctype html>
<html>
... | expected_html | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_middleware.py | test_session_middleware | assert | numeric_literal | 31 | from fastapi.testclient import TestClient
import air
def test_session_middleware() -> None:
app = air.Air()
app.add_middleware(air.SessionMiddleware, secret_key="change-me")
@app.page
async def check(request: air.Request):
return air.layouts.mvpcss(
air.H1(request.session.get("tim... | 200 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_requests.py | test_is_htmx | assert | numeric_literal | 21 | import json
from typing import Annotated
from fastapi.testclient import TestClient
from air import H1, Air, AirRequest, Request, is_htmx_request
def test_is_htmx() -> None:
"""Test the is_htmx method, which only works if the response is wrapped."""
app = Air()
@app.get("/test")
def test_endpoint(is... | 200 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_requests.py | test_htmx_triggering_event | assert | string_literal | 26 | import json
from typing import Annotated
from fastapi.testclient import TestClient
from air import H1, Air, AirRequest, Request, is_htmx_request
def test_htmx_triggering_event() -> None:
app = Air()
@app.get("/test")
def test_endpoint(request: AirRequest) -> H1:
event = request.htmx.triggering_e... | "<h1>Event: None</h1>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_requests.py | test_htmx_prompt | assert | string_literal | 22 | import json
from typing import Annotated
from fastapi.testclient import TestClient
from air import H1, Air, AirRequest, Request, is_htmx_request
def test_htmx_prompt() -> None:
app = Air()
@app.get("/test")
def test_endpoint(request: Request) -> H1:
return H1(f"Prompt: {request.htmx.prompt}")
... | "<h1>Prompt: None</h1>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_requests.py | test_htmx_target | assert | string_literal | 22 | import json
from typing import Annotated
from fastapi.testclient import TestClient
from air import H1, Air, AirRequest, Request, is_htmx_request
def test_htmx_target() -> None:
app = Air()
@app.get("/test")
def test_endpoint(request: Request) -> H1:
return H1(f"Target: {request.htmx.target}")
... | "<h1>Target: None</h1>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_requests.py | test_htmx_triggering_event | assert | string_literal | 23 | import json
from typing import Annotated
from fastapi.testclient import TestClient
from air import H1, Air, AirRequest, Request, is_htmx_request
def test_htmx_triggering_event() -> None:
app = Air()
@app.get("/test")
def test_endpoint(request: AirRequest) -> H1:
event = request.htmx.triggering_e... | "<h1>Event: click</h1>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_requests.py | test_htmx_trigger | assert | string_literal | 22 | import json
from typing import Annotated
from fastapi.testclient import TestClient
from air import H1, Air, AirRequest, Request, is_htmx_request
def test_htmx_trigger() -> None:
app = Air()
@app.get("/test")
def test_endpoint(request: Request) -> H1:
return H1(f"Trigger: {request.htmx.trigger}")... | "<h1>Trigger: None</h1>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_requests.py | test_htmx_current_url_abs_path | assert | string_literal | 22 | import json
from typing import Annotated
from fastapi.testclient import TestClient
from air import H1, Air, AirRequest, Request, is_htmx_request
def test_htmx_current_url_abs_path() -> None:
app = Air()
@app.get("/test")
def test_endpoint(request: Request) -> H1:
return H1(f"Abs path: {request.h... | "<h1>Abs path: None</h1>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_requests.py | test_htmx_target | assert | string_literal | 19 | import json
from typing import Annotated
from fastapi.testclient import TestClient
from air import H1, Air, AirRequest, Request, is_htmx_request
def test_htmx_target() -> None:
app = Air()
@app.get("/test")
def test_endpoint(request: Request) -> H1:
return H1(f"Target: {request.htmx.target}")
... | "<h1>Target: my-div</h1>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_requests.py | test_is_htmx | assert | string_literal | 22 | import json
from typing import Annotated
from fastapi.testclient import TestClient
from air import H1, Air, AirRequest, Request, is_htmx_request
def test_is_htmx() -> None:
"""Test the is_htmx method, which only works if the response is wrapped."""
app = Air()
@app.get("/test")
def test_endpoint(is... | "text/html; charset=utf-8" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_requests.py | test_htmx_boosted | assert | string_literal | 19 | import json
from typing import Annotated
from fastapi.testclient import TestClient
from air import H1, Air, AirRequest, Request, is_htmx_request
def test_htmx_boosted() -> None:
app = Air()
@app.get("/test")
def test_endpoint(request: Request) -> H1:
return H1(f"Is boosted: {request.htmx.boosted... | "<h1>Is boosted: True</h1>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_responses.py | test_TagResponse_obj | assert | numeric_literal | 23 | from typing import override
from fastapi import status
from fastapi.testclient import TestClient
import air
from air import H1, AirResponse, Article, BaseTag, Div, Html, Main
from .utils import clean_doc
def test_TagResponse_obj() -> None:
"""Test the TagResponse class."""
app = air.Air()
@app.get("/te... | 200 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_responses.py | test_AirResponse_html | assert | variable | 49 | from typing import override
from fastapi import status
from fastapi.testclient import TestClient
import air
from air import H1, AirResponse, Article, BaseTag, Div, Html, Main
from .utils import clean_doc
def test_AirResponse_html() -> None:
"""Test the AirResponse class."""
app = air.Air()
@app.get("/... | expected_html | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_responses.py | test_SSEResponse_bytes_content | assert | string_literal | 27 | from typing import override
from fastapi import status
from fastapi.testclient import TestClient
import air
from air import H1, AirResponse, Article, BaseTag, Div, Html, Main
from .utils import clean_doc
def test_SSEResponse_bytes_content() -> None:
app = air.Air()
async def event_generator():
yiel... | "already encoded" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_responses.py | test_RedirectResponse | assert | complex_expr | 31 | from typing import override
from fastapi import status
from fastapi.testclient import TestClient
import air
from air import H1, AirResponse, Article, BaseTag, Div, Html, Main
from .utils import clean_doc
def test_RedirectResponse() -> None:
"""Test the RedirectResponse class."""
app = air.Air()
@app.ge... | response.url.path | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_responses.py | test_TagResponse_obj | assert | string_literal | 25 | from typing import override
from fastapi import status
from fastapi.testclient import TestClient
import air
from air import H1, AirResponse, Article, BaseTag, Div, Html, Main
from .utils import clean_doc
def test_TagResponse_obj() -> None:
"""Test the TagResponse class."""
app = air.Air()
@app.get("/te... | "<h1>Hello, World!</h1>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_routing.py | test_air_routing | assert | numeric_literal | 28 | import pytest
from fastapi.testclient import TestClient
from starlette.responses import HTMLResponse
from starlette.routing import NoMatchFound
import air
from air import H1
def test_air_routing() -> None:
app = air.Air()
router = air.AirRouter()
@app.page
def index() -> H1:
return air.H1("H... | 200 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_routing.py | test_air_router_default_404_handler | assert | numeric_literal | 20 | import pytest
from fastapi.testclient import TestClient
from starlette.responses import HTMLResponse
from starlette.routing import NoMatchFound
import air
from air import H1
def test_air_router_default_404_handler() -> None:
"""Test that AirRouter correctly configures the default 404 handler."""
router = air.... | 404 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_routing.py | test_air_router_prefix_validation | assert | string_literal | 22 | import pytest
from fastapi.testclient import TestClient
from starlette.responses import HTMLResponse
from starlette.routing import NoMatchFound
import air
from air import H1
def test_air_router_prefix_validation() -> None:
"""Test prefix validation assertions"""
# Test prefix must start with '/'
with pyte... | "/api" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_routing.py | test_air_router_default_404_handler | assert | complex_expr | 21 | import pytest
from fastapi.testclient import TestClient
from starlette.responses import HTMLResponse
from starlette.routing import NoMatchFound
import air
from air import H1
def test_air_router_default_404_handler() -> None:
"""Test that AirRouter correctly configures the default 404 handler."""
router = air.... | response.text | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_routing.py | test_air_router_default_not_none | assert | variable | 18 | import pytest
from fastapi.testclient import TestClient
from starlette.responses import HTMLResponse
from starlette.routing import NoMatchFound
import air
from air import H1
def test_air_router_default_not_none() -> None:
"""Test AirRouter when default parameter is not None (covers other branch)"""
def custo... | custom_default | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_stock_tags_coverage.py | test_stock_tags_comprehensive_coverage | assert | numeric_literal | 136 | import air
from air import SelfClosingTag
def test_stock_tags_comprehensive_coverage() -> None:
"""Test that covers all stock tag classes to improve __init__ coverage."""
# Test BaseTag subclasses with children and various attributes
tags_with_children = [
# Basic tags
air.A("Link", href="... | 0 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_stock_tags_coverage.py | test_stock_tags_comprehensive_coverage | assert | numeric_literal | 143 | import air
from air import SelfClosingTag
def test_stock_tags_comprehensive_coverage() -> None:
"""Test that covers all stock tag classes to improve __init__ coverage."""
# Test BaseTag subclasses with children and various attributes
tags_with_children = [
# Basic tags
air.A("Link", href="... | 90 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_svg.py | test_circle_with_attributes | assert | variable | 9 | import air
from .utils import clean_doc, clean_doc_with_broken_lines
def test_circle_with_attributes() -> None:
circle = air.svg.Circle(cx=50, cy=50, r=25, class_="my-circle")
expected = '<circle cx="50" cy="50" r="25" class="my-circle"></circle>'
assert circle.render() == | expected | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags.py | test_safestr | assert | string_literal | 16 | from typing import Any, override
import pytest
from full_match import match as full_match
import air
from .utils import clean_doc
def _r(tag: air.BaseTag):
"""Shortcut for easy renders"""
return tag.render()
def test_safestr() -> None:
assert repr(air.SafeStr("test")) == | "'test'" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags.py | test_atag_no_attrs_no_children | assert | string_literal | 16 | from typing import Any, override
import pytest
from full_match import match as full_match
import air
from .utils import clean_doc
def _r(tag: air.BaseTag):
"""Shortcut for easy renders"""
return tag.render()
def test_atag_no_attrs_no_children() -> None:
assert air.A().render() == | "<a></a>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags.py | test_other_children_types | assert | string_literal | 16 | from typing import Any, override
import pytest
from full_match import match as full_match
import air
from .utils import clean_doc
def _r(tag: air.BaseTag):
"""Shortcut for easy renders"""
return tag.render()
def test_other_children_types() -> None:
assert air.A(1).render() == | "<a>1</a>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags.py | test_raw_html_invalid_args | pytest.raises | variable | 17 | from typing import Any, override
import pytest
from full_match import match as full_match
import air
from .utils import clean_doc
def _r(tag: air.BaseTag):
"""Shortcut for easy renders"""
return tag.render()
def test_raw_html_invalid_args() -> None:
"""Test that Raw raises errors with invalid arguments... | TypeError) | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags.py | test_divtag_yes_attrs_multiple_a_children | assert | variable | 28 | from typing import Any, override
import pytest
from full_match import match as full_match
import air
from .utils import clean_doc
def _r(tag: air.BaseTag):
"""Shortcut for easy renders"""
return tag.render()
def test_divtag_yes_attrs_multiple_a_children() -> None:
actual_html = air.Div(
air.A("... | expected_html | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags.py | test_tag_label_as | assert | string_literal | 17 | from typing import Any, override
import pytest
from full_match import match as full_match
import air
from .utils import clean_doc
def _r(tag: air.BaseTag):
"""Shortcut for easy renders"""
return tag.render()
def test_tag_label_as() -> None:
html = _r(air.Link(as_="fred"))
assert html == | '<link as="fred">' | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags.py | test_input_boolean_attributes | assert | string_literal | 24 | from typing import Any, override
import pytest
from full_match import match as full_match
import air
from .utils import clean_doc
def _r(tag: air.BaseTag):
"""Shortcut for easy renders"""
return tag.render()
def test_input_boolean_attributes() -> None:
"""Test that Input tag boolean attributes render c... | '<input name="q">' | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags.py | test_children_tag | assert | string_literal | 17 | from typing import Any, override
import pytest
from full_match import match as full_match
import air
from .utils import clean_doc
def _r(tag: air.BaseTag):
"""Shortcut for easy renders"""
return tag.render()
def test_children_tag() -> None:
html = _r(air.Children(air.P("Hello, world!")))
assert ht... | "<p>Hello, world!</p>" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags.py | test_input_boolean_attributes | assert | string_literal | 52 | from typing import Any, override
import pytest
from full_match import match as full_match
import air
from .utils import clean_doc
def _r(tag: air.BaseTag):
"""Shortcut for easy renders"""
return tag.render()
def test_input_boolean_attributes() -> None:
"""Test that Input tag boolean attributes render c... | '<input name="email">' | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags_utils.py | test_compact_format_html_minifies | assert | numeric_literal | 151 | from __future__ import annotations
import sys
import types
from collections import UserString
from collections.abc import Iterator
from dataclasses import dataclass
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import AIR_TAG_SAMPLE, SMALL_AIR_TAG_SAMPLE
from full... | 760 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags_utils.py | test_migrate_attribute_name_to_html | assert | string_literal | 152 | from __future__ import annotations
import sys
import types
from collections import UserString
from collections.abc import Iterator
from dataclasses import dataclass
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import AIR_TAG_SAMPLE, SMALL_AIR_TAG_SAMPLE
from full... | "id" | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags_utils.py | test_compact_format_html_minifies | assert | numeric_literal | 152 | from __future__ import annotations
import sys
import types
from collections import UserString
from collections.abc import Iterator
from dataclasses import dataclass
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import AIR_TAG_SAMPLE, SMALL_AIR_TAG_SAMPLE
from full... | 7530 | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
feldroy/air | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | train | train | tests/test_tags_utils.py | fake_format_html | assert | bool_literal | 151 | from __future__ import annotations
import sys
import types
from collections import UserString
from collections.abc import Iterator
from dataclasses import dataclass
from pathlib import Path
from typing import Any
import pytest
from examples.samples.air_tag_samples import AIR_TAG_SAMPLE, SMALL_AIR_TAG_SAMPLE
from full... | True | 33c644b4d1efc142236c3d3a8054ea0b431afb7c | 138 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.