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
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os from typing import Any, cast import pytest from tests.utils import assert_matches_type from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.types import Model, ListModelsResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") class T...
model)
assert_*
variable
tests/api_resources/test_models.py
test_raw_response_retrieve
TestModels
38
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Iterator, AsyncIterator import httpx import pytest from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs._streaming import Stream, AsyncStream, ServerSentEvent @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])...
""
assert
string_literal
tests/test_streaming.py
test_event_missing_data
56
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os import inspect import traceback import contextlib from typing import Any, TypeVar, Iterator, Sequence, cast from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type from dedalus_labs._types import Omit, NoneType from deda...
None
assert
none_literal
tests/utils.py
assert_matches_type
67
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from urllib.parse import parse_qs, urlparse import httpx import pytest from dedalus_labs._exceptions import APIError, APIStatusError, BadRequestError from dedalus_labs.lib._bug_report import generate_bug_report_url, get_bug_report_url_from_error class TestGenerateBugReportUrl: ...
"github.com"
assert
string_literal
tests/test__bug_report.py
test_minimal_parameters
TestGenerateBugReportUrl
30
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from urllib.parse import parse_qs, urlparse import httpx import pytest from dedalus_labs._exceptions import APIError, APIStatusError, BadRequestError from dedalus_labs.lib._bug_report import generate_bug_report_url, get_bug_report_url_from_error class TestGenerateBugReportUrl: ...
params["notes"][0]
assert
complex_expr
tests/test__bug_report.py
test_request_id_in_notes
TestGenerateBugReportUrl
66
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os from typing import Any, cast import pytest from tests.utils import assert_matches_type from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.types.audio import TranslationCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") c...
"python"
assert
string_literal
tests/api_resources/audio/test_translations.py
test_raw_response_create
TestTranslations
50
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import Any import pytest from pydantic import ValidationError from dedalus_labs.lib.mcp import ( MCPServerWireSpec, serialize_mcp_servers, MCPServerProtocol, is_mcp_server, ) class TestMCPServerWireSpecValidation: def test_requires_slug...
ValidationError)
pytest.raises
variable
tests/test_mcp_wire.py
test_requires_slug_or_url
TestMCPServerWireSpecValidation
91
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Sequence import pytest from dedalus_labs._types import FileTypes from dedalus_labs._utils import extract_files def test_multiple_files() -> None: query = {"documents": [{"file": b"My first file"}, {"file": b"My second file"}]} assert extract_files(query...
[ ("documents[][file]", b"My first file"), ("documents[][file]", b"My second file"), ]
assert
collection
tests/test_extract_files.py
test_multiple_files
31
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Any import pytest from dedalus_labs.lib.mcp import ( serialize_connection, collect_unique_connections, match_credentials_to_connections, validate_credentials_for_servers, ) class TestSerializeConnection: def test_duck_type_extraction(self) -...
"bare"
assert
string_literal
tests/test_mcp_wire_connections.py
test_duck_type_extraction
TestSerializeConnection
116
null
dedalus-labs/dedalus-sdk-python
from dedalus_labs._utils import deepcopy_minimal def assert_different_identities(obj1: object, obj2: object) -> None: assert obj1 == obj2 assert id(obj1) != id(obj2) def test_complex_nested_dict() -> None: obj1 = {"foo": {"bar": [{"hello": "world"}]}} obj2 = deepcopy_minimal(obj1) assert_different...
obj2["foo"]["bar"])
assert_*
complex_expr
tests/test_deepcopy.py
test_complex_nested_dict
27
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from urllib.parse import parse_qs, urlparse import httpx import pytest from dedalus_labs._exceptions import APIError, APIStatusError, BadRequestError from dedalus_labs.lib._bug_report import generate_bug_report_url, get_bug_report_url_from_error class TestGenerateBugReportUrl: ...
params
assert
variable
tests/test__bug_report.py
test_minimal_parameters
TestGenerateBugReportUrl
34
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Any import pytest from dedalus_labs.lib.mcp import ( serialize_connection, collect_unique_connections, match_credentials_to_connections, validate_credentials_for_servers, ) class TestCollectUniqueConnections: def test_same_name_different_obj...
github_a
assert
variable
tests/test_mcp_wire_connections.py
test_same_name_different_objects
TestCollectUniqueConnections
233
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import io import pathlib from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast from datetime import date, datetime from typing_extensions import Required, Annotated, TypedDict import pytest from dedalus_labs._types import Base64FileInput, omit, not_given from...
[1, 2, 3]
assert
collection
tests/test_transform.py
test_transform_skipping
446
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import io import pathlib from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast from datetime import date, datetime from typing_extensions import Required, Annotated, TypedDict import pytest from dedalus_labs._types import Base64FileInput, omit, not_given from...
data
assert
variable
tests/test_transform.py
test_transform_skipping
442
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Any import pytest from dedalus_labs.lib.mcp import ( serialize_connection, collect_unique_connections, match_credentials_to_connections, validate_credentials_for_servers, ) class TestCollectUniqueConnections: def test_multiple_servers_multip...
3
assert
numeric_literal
tests/test_mcp_wire_connections.py
test_multiple_servers_multiple_connections
TestCollectUniqueConnections
246
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Any import pytest from dedalus_labs.lib.mcp import ( serialize_connection, collect_unique_connections, match_credentials_to_connections, validate_credentials_for_servers, ) class TestMatchSecretsToConnections: def test_with_dict_inputs(self)...
"api"
assert
string_literal
tests/test_mcp_wire_connections.py
test_with_dict_inputs
TestMatchSecretsToConnections
164
null
dedalus-labs/dedalus-sdk-python
from typing import Any, cast from functools import partial from urllib.parse import unquote import pytest from dedalus_labs._qs import Querystring, stringify def test_nested_brackets() -> None: assert unquote(stringify({"a": {"b": "c"}})) == "a[b]=c" assert unquote(stringify({"a": {"b": "c", "d": "e", "f": ...
"a[b]=c&a[d]=e&a[f]=g"
assert
string_literal
tests/test_qs.py
test_nested_brackets
40
null
dedalus-labs/dedalus-sdk-python
from typing import Any, cast from functools import partial from urllib.parse import unquote import pytest from dedalus_labs._qs import Querystring, stringify def test_basic() -> None: assert stringify({"a": 1}) == "a=1" assert stringify({"a": "b"}) == "a=b" assert stringify({"a": True}) == "a=true" ...
"a=false"
assert
string_literal
tests/test_qs.py
test_basic
20
null
dedalus-labs/dedalus-sdk-python
from typing import Any, cast from functools import partial from urllib.parse import unquote import pytest from dedalus_labs._qs import Querystring, stringify @pytest.mark.parametrize("method", ["class", "function"]) def test_array_brackets(method: str) -> None: if method == "class": serialise = Querystri...
"in[]=foo&in[]=bar"
assert
string_literal
tests/test_qs.py
test_array_brackets
71
null
dedalus-labs/dedalus-sdk-python
import json from typing import Any, List, Union, cast from typing_extensions import Annotated import httpx import pytest import pydantic from dedalus_labs import Dedalus, BaseModel, AsyncDedalus from dedalus_labs._response import ( APIResponse, BaseAPIResponse, AsyncAPIResponse, BinaryAPIResponse, ...
str
assert
variable
tests/test_response.py
test_extract_response_type_direct_classes
32
null
dedalus-labs/dedalus-sdk-python
from typing import Any, cast from functools import partial from urllib.parse import unquote import pytest from dedalus_labs._qs import Querystring, stringify def test_nested_brackets() -> None: assert unquote(stringify({"a": {"b": "c"}})) ==
"a[b]=c"
assert
string_literal
tests/test_qs.py
test_nested_brackets
39
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import base64 import json from typing import Any import pytest pytest.importorskip("cryptography") from cryptography.hazmat.primitives.asymmetric import rsa, padding from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.ciphers.aead import AESGCM fr...
expected_public.public_numbers().e
assert
func_call
tests/test_encryption.py
test_valid_jwk
TestJwkToPublicKey
122
null
dedalus-labs/dedalus-sdk-python
import operator from typing import Any from typing_extensions import override from dedalus_labs._utils import LazyProxy def test_recursive_proxy() -> None: proxy = RecursiveLazyProxy() assert repr(proxy) == "RecursiveLazyProxy" assert str(proxy) == "RecursiveLazyProxy" assert dir(proxy) ==
[]
assert
collection
tests/test_utils/test_proxy.py
test_recursive_proxy
21
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import base64 import json from typing import Any import pytest pytest.importorskip("cryptography") from cryptography.hazmat.primitives.asymmetric import rsa, padding from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.ciphers.aead import AESGCM fr...
ValueError, match="below minimum")
pytest.raises
complex_expr
tests/test_encryption.py
test_small_key_rejected
TestJwkToPublicKey
144
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import pytest from dedalus_labs._utils import required_args def test_multiple_variants() -> None: @required_args(["a"], ["b"]) def foo(*, a: str | None = None, b: str | None = None) -> str | None: return a if a is not None else b assert foo(a="foo") == "foo" ...
"bar"
assert
string_literal
tests/test_required_args.py
test_multiple_variants
77
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import io import pathlib from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast from datetime import date, datetime from typing_extensions import Required, Annotated, TypedDict import pytest from dedalus_labs._types import Base64FileInput, omit, not_given from...
{"bar": None}
assert
collection
tests/test_transform.py
test_optional_iso8601_format
214
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Any import pytest from dedalus_labs.lib.mcp import ( serialize_connection, collect_unique_connections, match_credentials_to_connections, validate_credentials_for_servers, ) class TestMatchSecretsToConnections: def test_basic_matching(self) -...
2
assert
numeric_literal
tests/test_mcp_wire_connections.py
test_basic_matching
TestMatchSecretsToConnections
137
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import pytest from dedalus_labs._utils import required_args def test_positional_param() -> None: @required_args(["a"]) def foo(a: str | None = None) -> str | None: return a assert foo("a") == "a" assert foo(None) is
None
assert
none_literal
tests/test_required_args.py
test_positional_param
23
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os from typing import Any, cast import pytest from tests.utils import assert_matches_type from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.types.audio import TranscriptionCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") ...
True
assert
bool_literal
tests/api_resources/audio/test_transcriptions.py
test_raw_response_create
TestTranscriptions
50
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import gc import os import sys import json import asyncio import inspect import tracemalloc from typing import Any, Union, cast from unittest import mock from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import ValidationErro...
{}
assert
collection
tests/test_client.py
test_copy_default_query
TestDedalus
166
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import pytest from dedalus_labs._utils import required_args def test_multiple_params() -> None: @required_args(["a", "b", "c"]) def foo(a: str = "", *, b: str = "", c: str = "") -> str | None: return f"{a} {b} {c}" assert foo(a="a", b="b", c="c") ==
"a b c"
assert
string_literal
tests/test_required_args.py
test_multiple_params
48
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import List, Generic, Iterator, cast from typing_extensions import Literal, TypeVar import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_functio...
None
assert
none_literal
tests/lib/chat/test_completions_streaming.py
test_stream_basic
TestSyncStream
87
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import base64 import json from typing import Any import pytest pytest.importorskip("cryptography") from cryptography.hazmat.primitives.asymmetric import rsa, padding from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.ciphers.aead import AESGCM fr...
credentials
assert
variable
tests/test_encryption.py
test_roundtrip
TestEncryptCredentials
173
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Generic, TypeVar, cast from dedalus_labs._utils import extract_type_var_from_base _T = TypeVar("_T") _T2 = TypeVar("_T2") _T3 = TypeVar("_T3") def test_extract_type_var() -> None: assert
int
assert
variable
tests/test_utils/test_typing.py
test_extract_type_var
28
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import io import pathlib from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast from datetime import date, datetime from typing_extensions import Required, Annotated, TypedDict import pytest from dedalus_labs._types import Base64FileInput, omit, not_given from...
{"foo": None}
assert
collection
tests/test_transform.py
test_iso8601_format
200
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import List, Generic, Iterator, cast from typing_extensions import Literal, TypeVar import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_functio...
"c"
assert
string_literal
tests/lib/chat/test_completions_streaming.py
test_stream_pydantic_tool
TestSyncStream
158
null
dedalus-labs/dedalus-sdk-python
from typing import Any, cast from functools import partial from urllib.parse import unquote import pytest from dedalus_labs._qs import Querystring, stringify def test_empty() -> None: assert stringify({}) ==
""
assert
string_literal
tests/test_qs.py
test_empty
11
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import gc import os import sys import json import asyncio import inspect import tracemalloc from typing import Any, Union, cast from unittest import mock from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import ValidationErro...
2
assert
numeric_literal
tests/test_client.py
test_non_application_json_content_type_for_json_data
TestDedalus
568
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import List from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_function_tool from dedalus_la...
"Science Fair"
assert
string_literal
tests/lib/chat/test_completions.py
test_parse_pydantic_model_with_list
TestSyncParse
135
null
dedalus-labs/dedalus-sdk-python
from typing import Any, cast from functools import partial from urllib.parse import unquote import pytest from dedalus_labs._qs import Querystring, stringify @pytest.mark.parametrize("method", ["class", "function"]) def test_nested_dotted(method: str) -> None: if method == "class": serialise = Querystrin...
"a.b=c&a.d=e&a.f=g"
assert
string_literal
tests/test_qs.py
test_nested_dotted
33
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import io import pathlib from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast from datetime import date, datetime from typing_extensions import Required, Annotated, TypedDict import pytest from dedalus_labs._types import Base64FileInput, omit, not_given from...
{"foo": True}
assert
collection
tests/test_transform.py
test_pydantic_mismatched_types
305
null
dedalus-labs/dedalus-sdk-python
from dedalus_labs._utils import deepcopy_minimal def assert_different_identities(obj1: object, obj2: object) -> None: assert obj1 ==
obj2
assert
variable
tests/test_deepcopy.py
assert_different_identities
5
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Generic, TypeVar, cast from dedalus_labs._utils import extract_type_var_from_base _T = TypeVar("_T") _T2 = TypeVar("_T2") _T3 = TypeVar("_T3") def test_extract_type_var_multiple() -> None: typ = BaseGenericMultipleTypeArgs[int, str, None] generic_bases ...
str
assert
variable
tests/test_utils/test_typing.py
test_extract_type_var_multiple
54
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import io import pathlib from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast from datetime import date, datetime from typing_extensions import Required, Annotated, TypedDict import pytest from dedalus_labs._types import Base64FileInput, omit, not_given from...
{}
assert
collection
tests/test_transform.py
test_pydantic_empty_model
285
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import List, Generic, Iterator, cast from typing_extensions import Literal, TypeVar import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_functio...
65
assert
numeric_literal
tests/lib/chat/test_completions_streaming.py
test_stream_pydantic_model
TestSyncStream
116
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import Any import pytest from pydantic import ValidationError from dedalus_labs.lib.mcp import ( MCPServerWireSpec, serialize_mcp_servers, MCPServerProtocol, is_mcp_server, ) class TestSerializeMCPServers: def test_none_returns_empty_li...
[]
assert
collection
tests/test_mcp_wire.py
test_none_returns_empty_list
TestSerializeMCPServers
215
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import pytest from dedalus_labs._utils import required_args def test_multiple_variants() -> None: @required_args(["a"], ["b"]) def foo(*, a: str | None = None, b: str | None = None) -> str | None: return a if a is not None else b assert foo(a="foo") ==
"foo"
assert
string_literal
tests/test_required_args.py
test_multiple_variants
76
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os import inspect import traceback import contextlib from typing import Any, TypeVar, Iterator, Sequence, cast from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type from dedalus_labs._types import Omit, NoneType from deda...
key)
assert_*
variable
tests/utils.py
assert_matches_type
109
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import List from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_function_tool from dedalus_la...
"Hello! How can I help you today?"
assert
string_literal
tests/lib/chat/test_completions.py
test_parse_without_response_format
TestSyncParse
154
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os from typing import Any, cast import pytest from tests.utils import assert_matches_type from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.types import CreateEmbeddingResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") class Tes...
embedding)
assert_*
variable
tests/api_resources/test_embeddings.py
test_raw_response_create
TestEmbeddings
52
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import List, Generic, Iterator, cast from typing_extensions import Literal, TypeVar import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_functio...
LengthFinishReasonError)
pytest.raises
variable
tests/lib/chat/test_completions_streaming.py
test_stream_max_tokens_error
TestSyncStream
210
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import List, Generic, Iterator, cast from typing_extensions import Literal, TypeVar import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_functio...
"I'm sorry, I can't assist with that."
assert
string_literal
tests/lib/chat/test_completions_streaming.py
test_stream_refusal
TestSyncStream
190
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Sequence import pytest from dedalus_labs._types import FileTypes from dedalus_labs._utils import extract_files def test_removes_files_from_input() -> None: query = {"foo": "bar"} assert extract_files(query, paths=[]) == [] assert query == {"foo": "ba...
[("foo[bar]", b"Bar")]
assert
collection
tests/test_extract_files.py
test_removes_files_from_input
25
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import base64 import json from typing import Any import pytest pytest.importorskip("cryptography") from cryptography.hazmat.primitives.asymmetric import rsa, padding from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.ciphers.aead import AESGCM fr...
Exception)
pytest.raises
variable
tests/test_encryption.py
test_wrong_key_fails
TestSecurityInvariants
229
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import List from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_function_tool from dedalus_la...
"f"
assert
string_literal
tests/lib/chat/test_completions.py
test_parse_pydantic_model
TestSyncParse
109
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os import inspect import traceback import contextlib from typing import Any, TypeVar, Iterator, Sequence, cast from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type from dedalus_labs._types import Omit, NoneType from deda...
value)
assert_*
variable
tests/utils.py
assert_matches_type
129
null
dedalus-labs/dedalus-sdk-python
import json from typing import Any, List, Union, cast from typing_extensions import Annotated import httpx import pytest import pydantic from dedalus_labs import Dedalus, BaseModel, AsyncDedalus from dedalus_labs._response import ( APIResponse, BaseAPIResponse, AsyncAPIResponse, BinaryAPIResponse, ...
int
assert
variable
tests/test_response.py
test_response_parse_custom_stream
105
null
dedalus-labs/dedalus-sdk-python
from dedalus_labs._utils import deepcopy_minimal def assert_different_identities(obj1: object, obj2: object) -> None: assert obj1 == obj2 assert id(obj1) != id(obj2) def test_nested_list() -> None: obj1 = ["a", [1, 2, 3]] obj2 = deepcopy_minimal(obj1) assert_different_identities(obj1, obj2) a...
obj2[1])
assert_*
complex_expr
tests/test_deepcopy.py
test_nested_list
41
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Sequence import pytest from dedalus_labs._types import FileTypes from dedalus_labs._utils import extract_files def test_removes_files_from_input() -> None: query = {"foo": "bar"} assert extract_files(query, paths=[]) == [] assert query == {"foo": "ba...
[("foo", b"Bar")]
assert
collection
tests/test_extract_files.py
test_removes_files_from_input
17
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import List from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_function_tool from dedalus_la...
"I'm sorry, I can't assist with that."
assert
string_literal
tests/lib/chat/test_completions.py
test_parse_refusal
TestSyncParse
176
null
dedalus-labs/dedalus-sdk-python
from pathlib import Path import anyio import pytest from dirty_equals import IsDict, IsList, IsBytes, IsTuple from dedalus_labs._files import to_httpx_files, async_to_httpx_files readme_path = Path(__file__).parent.parent.joinpath("README.md") def test_pathlib_includes_file_name() -> None: result = to_httpx_fil...
IsDict({"file": IsTuple("README.md", IsBytes())})
assert
func_call
tests/test_files.py
test_pathlib_includes_file_name
15
null
dedalus-labs/dedalus-sdk-python
from typing import Any, cast from functools import partial from urllib.parse import unquote import pytest from dedalus_labs._qs import Querystring, stringify @pytest.mark.parametrize("method", ["class", "function"]) def test_nested_dotted(method: str) -> None: if method == "class": serialise = Querystrin...
"a.b.c.d=e"
assert
string_literal
tests/test_qs.py
test_nested_dotted
34
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os from typing import Any, cast import pytest from tests.utils import assert_matches_type from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.types.chat import ( ChatCompletion, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") clas...
"python"
assert
string_literal
tests/api_resources/chat/test_completions.py
test_raw_response_create_overload_1
TestCompletions
149
null
dedalus-labs/dedalus-sdk-python
from dedalus_labs._utils import deepcopy_minimal def assert_different_identities(obj1: object, obj2: object) -> None: assert obj1 == obj2 assert id(obj1) !=
id(obj2)
assert
func_call
tests/test_deepcopy.py
assert_different_identities
6
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import List from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_function_tool from dedalus_la...
["Alice", "Bob"]
assert
collection
tests/lib/chat/test_completions.py
test_parse_pydantic_model_with_list
TestSyncParse
137
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import List from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_function_tool from dedalus_la...
"c"
assert
string_literal
tests/lib/chat/test_completions.py
test_parse_pydantic_tool
TestSyncParse
219
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Sequence import pytest from dedalus_labs._types import FileTypes from dedalus_labs._utils import extract_files @pytest.mark.parametrize( "query,paths,expected", [ [ {"foo": {"bar": "baz"}}, [["foo", "<array>", "bar"]], ...
expected
assert
variable
tests/test_extract_files.py
test_ignores_incorrect_paths
64
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import base64 import json from typing import Any import pytest pytest.importorskip("cryptography") from cryptography.hazmat.primitives.asymmetric import rsa, padding from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.ciphers.aead import AESGCM fr...
min_len
assert
variable
tests/test_encryption.py
test_envelope_format
TestEncryptCredentials
161
null
dedalus-labs/dedalus-sdk-python
from pathlib import Path import anyio import pytest from dirty_equals import IsDict, IsList, IsBytes, IsTuple from dedalus_labs._files import to_httpx_files, async_to_httpx_files readme_path = Path(__file__).parent.parent.joinpath("README.md") def test_tuple_input() -> None: result = to_httpx_files([("file", re...
IsList(IsTuple("file", IsTuple("README.md", IsBytes())))
assert
func_call
tests/test_files.py
test_tuple_input
21
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import Any import pytest from pydantic import ValidationError from dedalus_labs.lib.mcp import ( MCPServerWireSpec, serialize_mcp_servers, MCPServerProtocol, is_mcp_server, ) class TestSerializeMCPServers: def test_server_without_url_us...
["org/my-server"]
assert
collection
tests/test_mcp_wire.py
test_server_without_url_uses_name_as_slug
TestSerializeMCPServers
255
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import io import pathlib from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast from datetime import date, datetime from typing_extensions import Required, Annotated, TypedDict import pytest from dedalus_labs._types import Base64FileInput, omit, not_given from...
None
assert
none_literal
tests/test_transform.py
test_pydantic_default_field
343
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import base64 import json from typing import Any import pytest pytest.importorskip("cryptography") from cryptography.hazmat.primitives.asymmetric import rsa, padding from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.ciphers.aead import AESGCM fr...
ValueError, match="expected RSA key type")
pytest.raises
complex_expr
tests/test_encryption.py
test_wrong_kty_raises
TestJwkToPublicKey
126
null
dedalus-labs/dedalus-sdk-python
from typing import Any, cast from functools import partial from urllib.parse import unquote import pytest from dedalus_labs._qs import Querystring, stringify def test_nested_brackets() -> None: assert unquote(stringify({"a": {"b": "c"}})) == "a[b]=c" assert unquote(stringify({"a": {"b": "c", "d": "e", "f": "...
"a[b]=true"
assert
string_literal
tests/test_qs.py
test_nested_brackets
42
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import List from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_function_tool from dedalus_la...
1
assert
numeric_literal
tests/lib/chat/test_completions.py
test_parse_pydantic_model
TestSyncParse
102
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os from typing import Any, cast import pytest from tests.utils import assert_matches_type from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.types import CreateEmbeddingResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") class Tes...
"python"
assert
string_literal
tests/api_resources/test_embeddings.py
test_raw_response_create
TestEmbeddings
50
null
dedalus-labs/dedalus-sdk-python
from typing import Any, cast from functools import partial from urllib.parse import unquote import pytest from dedalus_labs._qs import Querystring, stringify @pytest.mark.parametrize("method", ["class", "function"]) def test_array_comma(method: str) -> None: if method == "class": serialise = Querystring(...
"a[b]=true,false"
assert
string_literal
tests/test_qs.py
test_array_comma
53
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import gc import os import sys import json import asyncio import inspect import tracemalloc from typing import Any, Union, cast from unittest import mock from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import ValidationErro...
0
assert
numeric_literal
tests/test_client.py
test_copy_default_options
TestDedalus
95
null
dedalus-labs/dedalus-sdk-python
import json from typing import Any, List, Union, cast from typing_extensions import Annotated import httpx import pytest import pydantic from dedalus_labs import Dedalus, BaseModel, AsyncDedalus from dedalus_labs._response import ( APIResponse, BaseAPIResponse, AsyncAPIResponse, BinaryAPIResponse, ...
"foo"
assert
string_literal
tests/test_response.py
test_response_parse_expect_model_union_non_json_content
260
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from urllib.parse import parse_qs, urlparse import httpx import pytest from dedalus_labs._exceptions import APIError, APIStatusError, BadRequestError from dedalus_labs.lib._bug_report import generate_bug_report_url, get_bug_report_url_from_error class TestGenerateBugReportUrl: ...
["Python SDK"]
assert
collection
tests/test__bug_report.py
test_minimal_parameters
TestGenerateBugReportUrl
33
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os from typing import Any, cast import httpx import pytest from respx import MockRouter from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs._response import ( BinaryAPIResponse, AsyncBinaryAPIResponse, StreamedBinaryAPIResponse, AsyncStreamedBina...
True
assert
bool_literal
tests/api_resources/audio/test_speech.py
test_method_create
TestSpeech
37
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import Any import pytest from pydantic import ValidationError from dedalus_labs.lib.mcp import ( MCPServerWireSpec, serialize_mcp_servers, MCPServerProtocol, is_mcp_server, ) class TestSerializeMCPServers: def test_mixed_list(self) -> N...
3
assert
numeric_literal
tests/test_mcp_wire.py
test_mixed_list
TestSerializeMCPServers
246
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os from typing import Any, cast import pytest from tests.utils import assert_matches_type from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.types.audio import TranscriptionCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") ...
transcription)
assert_*
variable
tests/api_resources/audio/test_transcriptions.py
test_raw_response_create
TestTranscriptions
53
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Generic, TypeVar, cast from dedalus_labs._utils import extract_type_var_from_base _T = TypeVar("_T") _T2 = TypeVar("_T2") _T3 = TypeVar("_T3") def test_extract_type_var_multiple() -> None: typ = BaseGenericMultipleTypeArgs[int, str, None] generic_bases ...
type(None)
assert
func_call
tests/test_utils/test_typing.py
test_extract_type_var_multiple
55
null
dedalus-labs/dedalus-sdk-python
import json from typing import Any, List, Union, cast from typing_extensions import Annotated import httpx import pytest import pydantic from dedalus_labs import Dedalus, BaseModel, AsyncDedalus from dedalus_labs._response import ( APIResponse, BaseAPIResponse, AsyncAPIResponse, BinaryAPIResponse, ...
bytes
assert
variable
tests/test_response.py
test_extract_response_type_concrete_subclasses
46
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Sequence import pytest from dedalus_labs._types import FileTypes from dedalus_labs._utils import extract_files def test_multiple_files() -> None: query = {"documents": [{"file": b"My first file"}, {"file": b"My second file"}]} assert extract_files(query,...
{"documents": [{}, {}]}
assert
collection
tests/test_extract_files.py
test_multiple_files
35
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import List, Generic, Iterator, cast from typing_extensions import Literal, TypeVar import httpx import pytest from respx import MockRouter from pydantic import BaseModel from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.lib._tools import pydantic_functio...
"UK"
assert
string_literal
tests/lib/chat/test_completions_streaming.py
test_stream_pydantic_tool
TestSyncStream
157
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os from typing import Any, cast import pytest from tests.utils import assert_matches_type from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.types.audio import TranscriptionCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") ...
"python"
assert
string_literal
tests/api_resources/audio/test_transcriptions.py
test_raw_response_create
TestTranscriptions
51
null
dedalus-labs/dedalus-sdk-python
from typing import Any, cast from functools import partial from urllib.parse import unquote import pytest from dedalus_labs._qs import Querystring, stringify def test_basic() -> None: assert stringify({"a": 1}) == "a=1" assert stringify({"a": "b"}) ==
"a=b"
assert
string_literal
tests/test_qs.py
test_basic
18
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import gc import os import sys import json import asyncio import inspect import tracemalloc from typing import Any, Union, cast from unittest import mock from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import ValidationErro...
200
assert
numeric_literal
tests/test_client.py
test_raw_response
TestDedalus
68
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import json from typing import Any import pytest from pydantic import ValidationError from dedalus_labs.lib.mcp import ( MCPServerWireSpec, serialize_mcp_servers, MCPServerProtocol, is_mcp_server, ) class TestMCPServerWireSpecConstruction: def test_from_slug_s...
None
assert
none_literal
tests/test_mcp_wire.py
test_from_slug_simple
TestMCPServerWireSpecConstruction
64
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from typing import Sequence import pytest from dedalus_labs._types import FileTypes from dedalus_labs._utils import extract_files def test_removes_files_from_input() -> None: query = {"foo": "bar"} assert extract_files(query, paths=[]) == [] assert query == {"foo": "ba...
{"hello": "world"}
assert
collection
tests/test_extract_files.py
test_removes_files_from_input
18
null
dedalus-labs/dedalus-sdk-python
from dedalus_labs._utils import deepcopy_minimal def assert_different_identities(obj1: object, obj2: object) -> None: assert obj1 == obj2 assert id(obj1) != id(obj2) def test_nested_dict() -> None: obj1 = {"foo": {"bar": True}} obj2 = deepcopy_minimal(obj1) assert_different_identities(obj1, obj2) ...
obj2["foo"])
assert_*
complex_expr
tests/test_deepcopy.py
test_nested_dict
19
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os from typing import Any, cast import pytest from tests.utils import assert_matches_type from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.types import CreateEmbeddingResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") class Tes...
True
assert
bool_literal
tests/api_resources/test_embeddings.py
test_raw_response_create
TestEmbeddings
49
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os from typing import Any, cast import pytest from tests.utils import assert_matches_type from dedalus_labs import Dedalus, AsyncDedalus from dedalus_labs.types.audio import TranslationCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") c...
True
assert
bool_literal
tests/api_resources/audio/test_translations.py
test_raw_response_create
TestTranslations
49
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations from urllib.parse import parse_qs, urlparse import httpx import pytest from dedalus_labs._exceptions import APIError, APIStatusError, BadRequestError from dedalus_labs.lib._bug_report import generate_bug_report_url, get_bug_report_url_from_error class TestGenerateBugReportUrl: ...
["custom.yml"]
assert
collection
tests/test__bug_report.py
test_custom_template
TestGenerateBugReportUrl
75
null
dedalus-labs/dedalus-sdk-python
from typing import Type, Union from datetime import date, datetime, timezone, timedelta import pytest from dedalus_labs._utils import parse_date, parse_datetime def create_tz(minutes: int) -> timezone: return timezone(timedelta(minutes=minutes)) @pytest.mark.parametrize( "value,result", [ # Vali...
result)
pytest.raises
variable
tests/test_utils/test_datetime_parse.py
test_date_parsing
55
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import os import inspect import traceback import contextlib from typing import Any, TypeVar, Iterator, Sequence, cast from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type from dedalus_labs._types import Omit, NoneType from deda...
item)
assert_*
variable
tests/utils.py
assert_matches_type
110
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import pytest from dedalus_labs._utils import required_args def test_multiple_params() -> None: @required_args(["a", "b", "c"]) def foo(a: str = "", *, b: str = "", c: str = "") -> str | None: return f"{a} {b} {c}" assert foo(a="a", b="b", c="c") == "a b c" ...
TypeError, match=error_message)
pytest.raises
complex_expr
tests/test_required_args.py
test_multiple_params
52
null
dedalus-labs/dedalus-sdk-python
import json from typing import TYPE_CHECKING, Any, Dict, List, Union, Optional, cast from datetime import datetime, timezone from typing_extensions import Literal, Annotated, TypeAliasType import pytest import pydantic from pydantic import Field from dedalus_labs._utils import PropertyInfo from dedalus_labs._compat i...
1
assert
numeric_literal
tests/test_models.py
test_unknown_fields
151
null
dedalus-labs/dedalus-sdk-python
from __future__ import annotations import gc import os import sys import json import asyncio import inspect import tracemalloc from typing import Any, Union, cast from unittest import mock from typing_extensions import Literal import httpx import pytest from respx import MockRouter from pydantic import ValidationErro...
7
assert
numeric_literal
tests/test_client.py
test_copy_default_options
TestDedalus
94
null