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
askui/python-sdk
import json import tempfile from pathlib import Path from typing import Any from unittest.mock import MagicMock, patch import pytest from askui.models.shared.settings import CachedExecutionToolSettings from askui.models.shared.tools import ToolCollection from askui.tools.caching_tools import ( ExecuteCachedTrajec...
RuntimeError, match="Toolbox not set")
pytest.raises
complex_expr
tests/unit/tools/test_caching_tools.py
test_execute_cached_execution_raises_error_without_toolbox
93
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import ( FeatureCreateParams, FeatureListQuery, FeatureModifyParams, ) from askui.tools.testing.feature_tools import ( CreateFeatureTool, DeleteFeatureTool, ListFeatureTool, ModifyFeatureTool, RetrieveFeatur...
"list"
assert
string_literal
tests/integration/tools/testing/test_feature_tools.py
test_list_features_empty
132
null
askui/python-sdk
import json import tempfile from pathlib import Path from typing import Any from unittest.mock import MagicMock, patch import pytest from askui.models.shared.settings import CachedExecutionToolSettings from askui.models.shared.tools import ToolCollection from askui.tools.caching_tools import ( ExecuteCachedTrajec...
2
assert
numeric_literal
tests/unit/tools/test_caching_tools.py
test_retrieve_cached_test_executions_lists_json_files
32
null
askui/python-sdk
import re from pathlib import Path import pytest from PIL import Image as PILImage from askui.locators import AiElement, Element, Image, Prompt, Text TEST_IMAGE_PATH = Path("tests/fixtures/images/github_com__icon.png") class TestImageLocator: _STR_PATTERN = re.compile( r'^element ".*" located by image ...
0.5
assert
numeric_literal
tests/unit/locators/test_locators.py
test_initialization_with_basic_params
TestImageLocator
125
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import ( FeatureCreateParams, FeatureListQuery, FeatureModifyParams, ) from askui.tools.testing.feature_tools import ( CreateFeatureTool, DeleteFeatureTool, ListFeatureTool, ModifyFeatureTool, RetrieveFeatur...
f2.name
assert
complex_expr
tests/integration/tools/testing/test_feature_tools.py
test_create_duplicate_names
92
null
askui/python-sdk
import base64 import pathlib import pytest from PIL import Image from askui.utils.image_utils import ( ImageSource, ScalingResults, base64_to_image, data_url_to_image, draw_point_on_image, image_to_base64, image_to_data_url, scale_coordinates, scale_image_to_fit, ) class TestImage...
100
assert
numeric_literal
tests/unit/utils/test_image_utils.py
test_to_data_url
TestImageSource
25
null
askui/python-sdk
import pathlib from typing import Any, Union import pytest from typing_extensions import override from askui import ( AgentSettings, ComputerAgent, Point, PointList, ResponseSchema, ResponseSchemaBase, ) from askui.locators.locators import Locator from askui.model_providers.detection_provider ...
"test value"
assert
string_literal
tests/integration/test_custom_models.py
test_use_response_schema_with_custom_image_qa_provider
TestCustomProviders
274
null
askui/python-sdk
import json import tempfile from pathlib import Path from typing import Any from askui.models.shared.agent_message_param import MessageParam, ToolUseBlockParam from askui.models.shared.agent_on_message_cb import OnMessageCbParam from askui.utils.cache_writer import CacheWriter def test_cache_writer_initialization() -...
[]
assert
collection
tests/unit/utils/test_cache_writer.py
test_cache_writer_initialization
19
null
askui/python-sdk
import pathlib from typing import Literal, Type import pytest from PIL import Image as PILImage from pydantic import BaseModel, RootModel from pytest_mock import MockerFixture from typing_extensions import override from askui import AgentSettings, ComputerAgent, ResponseSchemaBase from askui.model_providers.image_qa_...
"John"
assert
string_literal
tests/e2e/agent/test_get.py
test_get_with_xlsx_with_gemini_model_with_response_schema
302
null
askui/python-sdk
import uuid from askui.telemetry.utils import hash_to_uuid4, is_valid_uuid4 def test_hash_to_uuid4_string_input() -> None: guid = "12345678901234567890123456789012" result = hash_to_uuid4(guid) # Verify it's a valid UUID uuid_obj = uuid.UUID(result) assert uuid_obj.version ==
4
assert
numeric_literal
tests/unit/telemetry/test_utils.py
test_hash_to_uuid4_string_input
25
null
askui/python-sdk
import time from unittest.mock import Mock import pytest from PIL import Image as PILImage from pydantic import ValidationError from askui.agent import ComputerAgent from askui.locators import Element from askui.models.exceptions import WaitUntilError class TestAgentWait: def test_wait_duration_float(self, visi...
wait_duration + 0.2
assert
complex_expr
tests/e2e/agent/test_wait.py
test_wait_duration_float
TestAgentWait
29
null
askui/python-sdk
import json import tempfile from pathlib import Path import pytest from askui.agent import ComputerAgent from askui.models.shared.agent_message_param import MessageParam from askui.models.shared.agent_on_message_cb import OnMessageCbParam from askui.models.shared.settings import CachedExecutionToolSettings, CachingSe...
ValueError, match="Cannot use on_message callback")
pytest.raises
complex_expr
tests/e2e/agent/test_act_caching.py
test_act_with_on_message_and_write_caching_raises_error
131
null
askui/python-sdk
import base64 import pathlib import pytest from PIL import Image from askui.utils.image_utils import ( ImageSource, ScalingResults, base64_to_image, data_url_to_image, draw_point_on_image, image_to_base64, image_to_data_url, scale_coordinates, scale_image_to_fit, ) class TestImage...
target_size
assert
variable
tests/unit/utils/test_image_utils.py
test_scale_image_smaller_than_target
TestImageScaling
177
null
askui/python-sdk
import re from pathlib import Path import pytest from PIL import Image as PILImage from askui.locators import AiElement, Element, Image, Prompt, Text TEST_IMAGE_PATH = Path("tests/fixtures/images/github_com__icon.png") class TestDescriptionLocator: def test_initialization_with_description(self) -> None: ...
"test"
assert
string_literal
tests/unit/locators/test_locators.py
test_initialization_with_description
TestDescriptionLocator
15
null
askui/python-sdk
import json import tempfile from pathlib import Path from typing import Any from askui.models.shared.agent_message_param import MessageParam, ToolUseBlockParam from askui.models.shared.agent_on_message_cb import OnMessageCbParam from askui.utils.cache_writer import CacheWriter def test_cache_writer_generate_writes_fi...
2
assert
numeric_literal
tests/unit/utils/test_cache_writer.py
test_cache_writer_generate_writes_file
171
null
askui/python-sdk
import pathlib import pytest from PIL import Image as PILImage from askui.agent import ComputerAgent from askui.locators import AiElement, Element, Prompt, Text from askui.locators.locators import Image from askui.models.exceptions import ElementNotFoundError class TestAgentLocate: def test_locate_with_string_l...
x
assert
variable
tests/e2e/agent/test_locate.py
test_locate_with_string_locator
TestAgentLocate
25
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import Feature from askui.tools.testing.scenario_models import ( ScenarioCreateParams, ScenarioExample, ScenarioListQuery, ScenarioModifyParams, ScenarioStep, ) from askui.tools.testing.scenario_tools import ( Creat...
steps
assert
variable
tests/integration/tools/testing/test_scenario_tools.py
test_create_scenario_multiple_steps
138
null
askui/python-sdk
from typing import TYPE_CHECKING from unittest.mock import Mock from PIL import Image as PILImage from askui.agent import ComputerAgent from askui.locators import Element class TestAgentOffset: def _setup_mocks( self, vision_agent: ComputerAgent, github_login_screenshot: PILImage.Image ) -> tuple[Mo...
expected_y)
assert_*
variable
tests/e2e/agent/test_agent_offset.py
test_click_with_positive_offset
TestAgentOffset
56
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.execution_models import ( Execution, ExecutionCreateParams, ExecutionListQuery, ExecutionModifyParams, ExecutionStatus, ExecutionStep, ) from askui.tools.testing.execution_tools import ( CreateExecutionTool, DeleteExecutio...
NotFoundError)
pytest.raises
variable
tests/integration/tools/testing/test_execution_tools.py
test_retrieve_deleted_id
135
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.execution_models import ( Execution, ExecutionCreateParams, ExecutionListQuery, ExecutionModifyParams, ExecutionStatus, ExecutionStep, ) from askui.tools.testing.execution_tools import ( CreateExecutionTool, DeleteExecutio...
[]
assert
collection
tests/integration/tools/testing/test_execution_tools.py
test_create_execution_minimal
76
null
askui/python-sdk
import re from pathlib import Path import pytest from PIL import Image as PILImage from askui.locators import AiElement, Element, Image, Prompt, Text TEST_IMAGE_PATH = Path("tests/fixtures/images/github_com__icon.png") class TestTextLocator: def test_initialization_with_positional_text(self) -> None: te...
"Hello"
assert
string_literal
tests/unit/locators/test_locators.py
test_initialization_with_positional_text
TestTextLocator
67
null
askui/python-sdk
import re from pathlib import Path import pytest from PIL import Image as PILImage from askui.locators import AiElement, Element, Image, Prompt, Text TEST_IMAGE_PATH = Path("tests/fixtures/images/github_com__icon.png") class TestTextLocator: def test_initialization_with_positional_text(self) -> None: te...
70
assert
numeric_literal
tests/unit/locators/test_locators.py
test_initialization_with_positional_text
TestTextLocator
69
null
askui/python-sdk
import uuid from askui.telemetry.utils import hash_to_uuid4, is_valid_uuid4 def test_hash_to_uuid4_string_input() -> None: guid = "12345678901234567890123456789012" result = hash_to_uuid4(guid) # Verify it's a valid UUID uuid_obj = uuid.UUID(result) assert uuid_obj.version == 4 assert uuid_o...
uuid.RFC_4122
assert
complex_expr
tests/unit/telemetry/test_utils.py
test_hash_to_uuid4_string_input
26
null
askui/python-sdk
import re import pytest from PIL import Image as PILImage from askui.locators import Element, Image, Prompt, Text from askui.locators.relatable import CircularDependencyError TEST_IMAGE = PILImage.new("RGB", (100, 100), color="red") def test_text_contains_str() -> None: text = Text("hello", match_type="contains...
'text containing text "hello"'
assert
string_literal
tests/unit/locators/serializers/test_locator_string_representation.py
test_text_contains_str
24
null
askui/python-sdk
import time from unittest.mock import Mock import pytest from PIL import Image as PILImage from pydantic import ValidationError from askui.agent import ComputerAgent from askui.locators import Element from askui.models.exceptions import WaitUntilError class TestAgentWait: def test_wait_duration_float(self, visi...
wait_duration - 0.1
assert
complex_expr
tests/e2e/agent/test_wait.py
test_wait_duration_float
TestAgentWait
28
null
askui/python-sdk
import pathlib from typing import Literal, Type import pytest from PIL import Image as PILImage from pydantic import BaseModel, RootModel from pytest_mock import MockerFixture from typing_extensions import override from askui import AgentSettings, ComputerAgent, ResponseSchemaBase from askui.model_providers.image_qa_...
response.page_context.title
assert
complex_expr
tests/e2e/agent/test_get.py
test_get_with_nested_and_inherited_response_schema
454
null
askui/python-sdk
from pathlib import Path from askui.utils.api_utils import ListQuery, list_resource_paths def _create_json_files(tmp_path: Path, names: list[str]) -> None: for name in names: (tmp_path / name).write_text("{}") def _create_non_json_files(tmp_path: Path, names: list[str]) -> None: for name in names: ...
3
assert
numeric_literal
tests/integration/utils/test_api_utils.py
test_list_resource_paths_limit
82
null
askui/python-sdk
import pathlib from typing import Any, Union import pytest from typing_extensions import override from askui import ( AgentSettings, ComputerAgent, Point, PointList, ResponseSchema, ResponseSchemaBase, ) from askui.locators.locators import Locator from askui.model_providers.detection_provider ...
"user"
assert
string_literal
tests/integration/test_custom_models.py
test_inject_and_use_custom_vlm_provider
TestCustomProviders
163
null
askui/python-sdk
from askui.models.shared.prompts import ActSystemPrompt from askui.prompts.act_prompts import ( ANDROID_AGENT_SYSTEM_PROMPT, ANDROID_CAPABILITIES, ANDROID_DEVICE_INFORMATION, ANDROID_RECOVERY_RULES, BROWSER_INSTALL_RULES, BROWSER_SPECIFIC_RULES, COMPUTER_AGENT_SYSTEM_PROMPT, COMPUTER_USE...
"Test"
assert
string_literal
tests/unit/prompts/test_act_prompts.py
test_act_system_prompt_is_pydantic_model
297
null
askui/python-sdk
import pytest from PIL import Image as PILImage from askui.locators import Element, Prompt, Text from askui.locators.locators import Image, Locator from askui.locators.relatable import CircularDependencyError from askui.locators.serializers import VlmLocatorSerializer TEST_IMAGE = PILImage.new("RGB", (100, 100), colo...
"a big red button"
assert
string_literal
tests/unit/locators/serializers/test_vlm_locator_serializer.py
test_serialize_description
56
null
askui/python-sdk
import pathlib from typing import Any, Union import pytest from typing_extensions import override from askui import ( AgentSettings, ComputerAgent, Point, PointList, ResponseSchema, ResponseSchemaBase, ) from askui.locators.locators import Locator from askui.model_providers.detection_provider ...
["test query"]
assert
collection
tests/integration/test_custom_models.py
test_inject_and_use_custom_image_qa_provider
TestCustomProviders
188
null
askui/python-sdk
import pytest from PIL import Image as PILImage from askui.agent import ComputerAgent from askui.exceptions import AutomationError from askui.locators import AiElement, Prompt, Text class TestAgentLocateWithDifferentModels: def test_locate_with_pta_model( self, agent_with_pta_model: ComputerAgent...
x
assert
variable
tests/e2e/agent/test_locate_with_different_models.py
test_locate_with_pta_model
TestAgentLocateWithDifferentModels
25
null
askui/python-sdk
import re from pathlib import Path import pytest from PIL import Image as PILImage from askui.locators import AiElement, Element, Image, Prompt, Text TEST_IMAGE_PATH = Path("tests/fixtures/images/github_com__icon.png") class TestImageLocator: _STR_PATTERN = re.compile( r'^element ".*" located by image ...
0
assert
numeric_literal
tests/unit/locators/test_locators.py
test_initialization_with_basic_params
TestImageLocator
128
null
askui/python-sdk
import machineid from pytest_mock import MockerFixture from askui.telemetry.device_id import get_device_id def test_get_device_id_returns_none_on_error(mocker: MockerFixture) -> None: mocker.patch("askui.telemetry.device_id._device_id", None) mocker.patch("machineid.hashed_id", side_effect=machineid.MachineId...
None
assert
none_literal
tests/unit/telemetry/test_device_id.py
test_get_device_id_returns_none_on_error
33
null
askui/python-sdk
import re from pathlib import Path import pytest from PIL import Image as PILImage from askui.locators import AiElement, Element, Image, Prompt, Text TEST_IMAGE_PATH = Path("tests/fixtures/images/github_com__icon.png") class TestClassLocator: def test_initialization_without_class_name(self) -> None: cl...
None
assert
none_literal
tests/unit/locators/test_locators.py
test_initialization_without_class_name
TestClassLocator
46
null
askui/python-sdk
import pathlib import sys from unittest.mock import patch import pytest from pydantic import ValidationError from askui.tools.askui.askui_controller_settings import AskUiControllerSettings class TestAskUiControllerSettings: def test_build_controller_path_windows(self) -> None: """Test _build_controller_...
expected_path
assert
variable
tests/unit/tools/askui/test_askui_controller_settings.py
test_build_controller_path_windows
TestAskUiControllerSettings
126
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import ( FeatureCreateParams, FeatureListQuery, FeatureModifyParams, ) from askui.tools.testing.feature_tools import ( CreateFeatureTool, DeleteFeatureTool, ListFeatureTool, ModifyFeatureTool, RetrieveFeatur...
1
assert
numeric_literal
tests/integration/tools/testing/test_feature_tools.py
test_retrieve_feature
106
null
askui/python-sdk
import json import tempfile from pathlib import Path from typing import Any from unittest.mock import MagicMock, patch import pytest from askui.models.shared.settings import CachedExecutionToolSettings from askui.models.shared.tools import ToolCollection from askui.tools.caching_tools import ( ExecuteCachedTrajec...
0.5
assert
numeric_literal
tests/unit/tools/test_caching_tools.py
test_execute_cached_execution_default_delay_time
333
null
askui/python-sdk
import askui from askui.telemetry.pkg_version import get_pkg_version def test_version_consistency() -> None: package_version = get_pkg_version() module_version = askui.__version__ assert package_version ==
module_version
assert
variable
tests/unit/test_version.py
test_version_consistency
8
null
askui/python-sdk
from typing import Any import pytest from askui.telemetry import InMemoryProcessor, Telemetry, TelemetrySettings def test_combined_exclude_and_include_first_arg() -> None: settings = TelemetrySettings(enabled=True) telemetry = Telemetry(settings) processor = InMemoryProcessor() telemetry.add_processo...
3
assert
numeric_literal
tests/unit/telemetry/test_telemetry.py
test_combined_exclude_and_include_first_arg
381
null
askui/python-sdk
import pathlib from typing import Any, Union import pytest from typing_extensions import override from askui import ( AgentSettings, ComputerAgent, Point, PointList, ResponseSchema, ResponseSchemaBase, ) from askui.locators.locators import Locator from askui.model_providers.detection_provider ...
"test response"
assert
string_literal
tests/integration/test_custom_models.py
test_inject_and_use_custom_image_qa_provider
TestCustomProviders
187
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import ( FeatureCreateParams, FeatureListQuery, FeatureModifyParams, ) from askui.tools.testing.feature_tools import ( CreateFeatureTool, DeleteFeatureTool, ListFeatureTool, ModifyFeatureTool, RetrieveFeatur...
["标签"]
assert
collection
tests/integration/tools/testing/test_feature_tools.py
test_create_feature_unicode
78
null
askui/python-sdk
import re from pathlib import Path import pytest from PIL import Image as PILImage from askui.locators import AiElement, Element, Image, Prompt, Text TEST_IMAGE_PATH = Path("tests/fixtures/images/github_com__icon.png") class TestClassLocator: def test_initialization_with_positional_arg(self) -> None: c...
"text"
assert
string_literal
tests/unit/locators/test_locators.py
test_initialization_with_positional_arg
TestClassLocator
51
null
askui/python-sdk
import pathlib import re import pytest from PIL import Image as PILImage from pytest_mock import MockerFixture from askui.locators import Element, Image, Prompt, Text from askui.locators.locators import Locator from askui.locators.relatable import CircularDependencyError from askui.locators.serializers import AskUiLo...
2
assert
numeric_literal
tests/unit/locators/serializers/test_askui_locator_serializer.py
test_serialize_multiple_images_with_relation
390
null
askui/python-sdk
import pathlib import pytest from PIL import Image as PILImage from askui.agent import ComputerAgent from askui.locators import Element, Image, Prompt, Text from askui.locators.locators import AiElement from askui.models.exceptions import ElementNotFoundError class TestAgentLocateWithRelations: def test_locate_...
x
assert
variable
tests/e2e/agent/test_locate_with_relations.py
test_locate_with_above_relation
TestAgentLocateWithRelations
25
null
askui/python-sdk
import re from pathlib import Path import pytest from PIL import Image as PILImage from askui.locators import AiElement, Element, Image, Prompt, Text TEST_IMAGE_PATH = Path("tests/fixtures/images/github_com__icon.png") class TestImageLocator: _STR_PATTERN = re.compile( r'^element ".*" located by image ...
0.7
assert
numeric_literal
tests/unit/locators/test_locators.py
test_initialization_with_custom_params
TestImageLocator
150
null
askui/python-sdk
import base64 import pathlib import pytest from PIL import Image from askui.utils.image_utils import ( ImageSource, ScalingResults, base64_to_image, data_url_to_image, draw_point_on_image, image_to_base64, image_to_data_url, scale_coordinates, scale_image_to_fit, ) class TestEdgeC...
(0, 0)
assert
collection
tests/unit/utils/test_image_utils.py
test_empty_image
TestEdgeCases
278
null
askui/python-sdk
import base64 import pathlib import pytest from PIL import Image from askui.utils.image_utils import ( ImageSource, ScalingResults, base64_to_image, data_url_to_image, draw_point_on_image, image_to_base64, image_to_data_url, scale_coordinates, scale_image_to_fit, ) class TestBase6...
"JPEG"
assert
string_literal
tests/unit/utils/test_image_utils.py
test_image_to_base64_format
TestBase64Conversion
143
null
askui/python-sdk
from askui.models.shared.prompts import ActSystemPrompt from askui.prompts.act_prompts import ( ANDROID_AGENT_SYSTEM_PROMPT, ANDROID_CAPABILITIES, ANDROID_DEVICE_INFORMATION, ANDROID_RECOVERY_RULES, BROWSER_INSTALL_RULES, BROWSER_SPECIFIC_RULES, COMPUTER_AGENT_SYSTEM_PROMPT, COMPUTER_USE...
""
assert
string_literal
tests/unit/prompts/test_act_prompts.py
test_act_system_prompt_with_only_empty_strings
85
null
askui/python-sdk
from askui.models.shared.prompts import ActSystemPrompt from askui.prompts.act_prompts import ( ANDROID_AGENT_SYSTEM_PROMPT, ANDROID_CAPABILITIES, ANDROID_DEVICE_INFORMATION, ANDROID_RECOVERY_RULES, BROWSER_INSTALL_RULES, BROWSER_SPECIFIC_RULES, COMPUTER_AGENT_SYSTEM_PROMPT, COMPUTER_USE...
0
assert
numeric_literal
tests/unit/prompts/test_act_prompts.py
test_prompt_constants_are_non_empty
258
null
askui/python-sdk
import json from typing import Any from unittest.mock import Mock import pytest from askui.models.exceptions import QueryNoResponseError from askui.models.openrouter.get_model import OpenRouterModel from askui.models.shared.settings import GetSettings from askui.models.types.response_schemas import ResponseSchemaBase...
"Test response"
assert
string_literal
tests/integration/models/openrouter/test_openrouter.py
test_basic_query_returns_string
47
null
askui/python-sdk
import json import tempfile from pathlib import Path import pytest from askui.agent import ComputerAgent from askui.models.shared.agent_message_param import MessageParam from askui.models.shared.agent_on_message_cb import OnMessageCbParam from askui.models.shared.settings import CachedExecutionToolSettings, CachingSe...
0
assert
numeric_literal
tests/e2e/agent/test_act_caching.py
test_act_with_caching_strategy_no
96
null
askui/python-sdk
import json import tempfile from pathlib import Path from typing import Any from unittest.mock import MagicMock, patch import pytest from askui.models.shared.settings import CachedExecutionToolSettings from askui.models.shared.tools import ToolCollection from askui.tools.caching_tools import ( ExecuteCachedTrajec...
1
assert
numeric_literal
tests/unit/tools/test_caching_tools.py
test_retrieve_cached_test_executions_respects_custom_format
71
null
askui/python-sdk
import pytest from PIL import Image as PILImage from askui.locators import Element, Prompt, Text from askui.locators.locators import Image, Locator from askui.locators.relatable import CircularDependencyError from askui.locators.serializers import VlmLocatorSerializer TEST_IMAGE = PILImage.new("RGB", (100, 100), colo...
'text similar to "hello"'
assert
string_literal
tests/unit/locators/serializers/test_vlm_locator_serializer.py
test_serialize_text_similar
20
null
askui/python-sdk
import json import tempfile from pathlib import Path from typing import Any from askui.models.shared.agent_message_param import MessageParam, ToolUseBlockParam from askui.models.shared.agent_on_message_cb import OnMessageCbParam from askui.utils.cache_writer import CacheWriter def test_cache_writer_generate_writes_fi...
"id2"
assert
string_literal
tests/unit/utils/test_cache_writer.py
test_cache_writer_generate_writes_file
174
null
askui/python-sdk
import pytest from pydantic import ValidationError from askui.utils.not_given import NOT_GIVEN, BaseModelWithNotGiven, NotGiven def test_notgiven_in_condition() -> None: fallback = 123 val = NOT_GIVEN result = val if val is not NOT_GIVEN else fallback assert result ==
fallback
assert
variable
tests/unit/utils/test_not_given.py
test_notgiven_in_condition
31
null
askui/python-sdk
from unittest.mock import patch import pytest from pydantic import ValidationError from askui.tools.askui.askui_controller_client_settings import ( AskUiControllerClientSettings, ) class TestAskUiControllerClientSettings: def test_defaults(self) -> None: """Defaults are applied when no environment v...
"localhost:23000"
assert
string_literal
tests/unit/tools/askui/test_askui_controller_client_settings.py
test_defaults
TestAskUiControllerClientSettings
18
null
askui/python-sdk
import json import tempfile from pathlib import Path from typing import Any from unittest.mock import MagicMock, patch import pytest from askui.models.shared.settings import CachedExecutionToolSettings from askui.models.shared.tools import ToolCollection from askui.tools.caching_tools import ( ExecuteCachedTrajec...
0.1
assert
numeric_literal
tests/unit/tools/test_caching_tools.py
test_execute_cached_execution_uses_delay_time_between_actions
292
null
askui/python-sdk
import pytest from pydantic import ValidationError from askui.utils.not_given import NOT_GIVEN, BaseModelWithNotGiven, NotGiven def test_notgiven_as_method_param() -> None: def func(x: int | NotGiven = NOT_GIVEN) -> int: return 42 if isinstance(x, NotGiven) else x assert func() ==
42
assert
numeric_literal
tests/unit/utils/test_not_given.py
test_notgiven_as_method_param
23
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import Feature from askui.tools.testing.scenario_models import ( ScenarioCreateParams, ScenarioExample, ScenarioListQuery, ScenarioModifyParams, ScenarioStep, ) from askui.tools.testing.scenario_tools import ( Creat...
scen_dict
assert
variable
tests/integration/tools/testing/test_scenario_tools.py
test_retrieve_scenario
151
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.execution_models import ( Execution, ExecutionCreateParams, ExecutionListQuery, ExecutionModifyParams, ExecutionStatus, ExecutionStep, ) from askui.tools.testing.execution_tools import ( CreateExecutionTool, DeleteExecutio...
0
assert
numeric_literal
tests/integration/tools/testing/test_execution_tools.py
test_list_executions_empty
142
null
askui/python-sdk
import pathlib from typing import Any, Union import pytest from typing_extensions import override from askui import ( AgentSettings, ComputerAgent, Point, PointList, ResponseSchema, ResponseSchemaBase, ) from askui.locators.locators import Locator from askui.model_providers.detection_provider ...
"test goal"
assert
string_literal
tests/integration/test_custom_models.py
test_inject_and_use_custom_vlm_provider
TestCustomProviders
167
null
askui/python-sdk
import pathlib from typing import Literal, Type import pytest from PIL import Image as PILImage from pydantic import BaseModel, RootModel from pytest_mock import MockerFixture from typing_extensions import override from askui import AgentSettings, ComputerAgent, ResponseSchemaBase from askui.model_providers.image_qa_...
0
assert
numeric_literal
tests/e2e/agent/test_get.py
test_get_with_integer_schema
596
null
askui/python-sdk
import pathlib from typing import Literal, Type import pytest from PIL import Image as PILImage from pydantic import BaseModel, RootModel from pytest_mock import MockerFixture from typing_extensions import override from askui import AgentSettings, ComputerAgent, ResponseSchemaBase from askui.model_providers.image_qa_...
response.lower()
assert
func_call
tests/e2e/agent/test_get.py
test_get_with_pdf_with_gemini_model
160
null
askui/python-sdk
import json import tempfile from pathlib import Path from typing import Any from unittest.mock import MagicMock, patch import pytest from askui.models.shared.settings import CachedExecutionToolSettings from askui.models.shared.tools import ToolCollection from askui.tools.caching_tools import ( ExecuteCachedTrajec...
result_json[0]
assert
complex_expr
tests/unit/tools/test_caching_tools.py
test_retrieve_cached_test_executions_respects_custom_format
72
null
askui/python-sdk
from typing import Optional, Tuple, Union import pytest from httpx import HTTPStatusError from typing_extensions import override from askui import AgentSettings, ComputerAgent, ConfigurableRetry from askui.locators.locators import Locator from askui.model_providers.detection_provider import DetectionProvider from ask...
(10, 10)
assert
collection
tests/integration/agent/test_retry.py
test_locate_retries_and_succeeds
109
null
askui/python-sdk
from typing import Any import pytest from askui.telemetry import InMemoryProcessor, Telemetry, TelemetrySettings def test_telemetry_enabled() -> None: settings = TelemetrySettings(enabled=True) telemetry = Telemetry(settings) processor = InMemoryProcessor() telemetry.add_processor(processor) @te...
2
assert
numeric_literal
tests/unit/telemetry/test_telemetry.py
test_telemetry_enabled
39
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import ( FeatureCreateParams, FeatureListQuery, FeatureModifyParams, ) from askui.tools.testing.feature_tools import ( CreateFeatureTool, DeleteFeatureTool, ListFeatureTool, ModifyFeatureTool, RetrieveFeatur...
ValueError)
pytest.raises
variable
tests/integration/tools/testing/test_feature_tools.py
test_retrieve_invalid_id
115
null
askui/python-sdk
import machineid from pytest_mock import MockerFixture from askui.telemetry.device_id import get_device_id def test_get_device_id_returns_hashed_id(mocker: MockerFixture) -> None: test_id = "02c2431a4608f230d2d759ac888d773d274229ebd9c9093249752dd839ee3ea3" mocker.patch("askui.telemetry.device_id._device_id", ...
test_id
assert
variable
tests/unit/telemetry/test_device_id.py
test_get_device_id_returns_hashed_id
26
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import Feature from askui.tools.testing.scenario_models import ( ScenarioCreateParams, ScenarioExample, ScenarioListQuery, ScenarioModifyParams, ScenarioStep, ) from askui.tools.testing.scenario_tools import ( Creat...
["new"]
assert
collection
tests/integration/tools/testing/test_scenario_tools.py
test_modify_scenario_partial
227
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import ( FeatureCreateParams, FeatureListQuery, FeatureModifyParams, ) from askui.tools.testing.feature_tools import ( CreateFeatureTool, DeleteFeatureTool, ListFeatureTool, ModifyFeatureTool, RetrieveFeatur...
f2.id
assert
complex_expr
tests/integration/tools/testing/test_feature_tools.py
test_create_duplicate_names
93
null
askui/python-sdk
import time from unittest.mock import Mock import pytest from PIL import Image as PILImage from pydantic import ValidationError from askui.agent import ComputerAgent from askui.locators import Element from askui.models.exceptions import WaitUntilError class TestAgentWait: def test_wait_with_locator_object( ...
1
assert
numeric_literal
tests/e2e/agent/test_wait.py
test_wait_with_locator_object
TestAgentWait
154
null
askui/python-sdk
from unittest.mock import patch import pytest from pydantic import ValidationError from askui.tools.askui.askui_controller_client_settings import ( AskUiControllerClientSettings, ) class TestAskUiControllerClientSettings: def test_server_autostart_from_constructor(self) -> None: """`server_autostart...
False
assert
bool_literal
tests/unit/tools/askui/test_askui_controller_client_settings.py
test_server_autostart_from_constructor
TestAskUiControllerClientSettings
61
null
askui/python-sdk
import json import tempfile from pathlib import Path from typing import Any from askui.models.shared.agent_message_param import MessageParam, ToolUseBlockParam from askui.models.shared.agent_on_message_cb import OnMessageCbParam from askui.utils.cache_writer import CacheWriter def test_cache_writer_generate_writes_fi...
"tool2"
assert
string_literal
tests/unit/utils/test_cache_writer.py
test_cache_writer_generate_writes_file
175
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.execution_models import ( Execution, ExecutionCreateParams, ExecutionListQuery, ExecutionModifyParams, ExecutionStatus, ExecutionStep, ) from askui.tools.testing.execution_tools import ( CreateExecutionTool, DeleteExecutio...
"pending"
assert
string_literal
tests/integration/tools/testing/test_execution_tools.py
test_create_execution_minimal
75
null
askui/python-sdk
import json import tempfile from pathlib import Path from typing import Any from unittest.mock import MagicMock, patch import pytest from askui.models.shared.settings import CachedExecutionToolSettings from askui.models.shared.tools import ToolCollection from askui.tools.caching_tools import ( ExecuteCachedTrajec...
result.lower()
assert
func_call
tests/unit/tools/test_caching_tools.py
test_execute_cached_execution_handles_errors_gracefully
213
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import ( FeatureCreateParams, FeatureListQuery, FeatureModifyParams, ) from askui.tools.testing.feature_tools import ( CreateFeatureTool, DeleteFeatureTool, ListFeatureTool, ModifyFeatureTool, RetrieveFeatur...
"测试✨"
assert
string_literal
tests/integration/tools/testing/test_feature_tools.py
test_create_feature_unicode
76
null
askui/python-sdk
from typing import TYPE_CHECKING from unittest.mock import Mock from PIL import Image as PILImage from askui.agent import ComputerAgent from askui.locators import Element class TestAgentOffset: def _setup_mocks( self, vision_agent: ComputerAgent, github_login_screenshot: PILImage.Image ) -> tuple[Mo...
y)
assert_*
variable
tests/e2e/agent/test_agent_offset.py
test_click_with_zero_offset
TestAgentOffset
105
null
askui/python-sdk
from typing import TYPE_CHECKING from unittest.mock import Mock from PIL import Image as PILImage from askui.agent import ComputerAgent from askui.locators import Element class TestAgentOffset: def _setup_mocks( self, vision_agent: ComputerAgent, github_login_screenshot: PILImage.Image ) -> tuple[Mo...
1)
assert_*
numeric_literal
tests/e2e/agent/test_agent_offset.py
test_click_with_positive_offset
TestAgentOffset
57
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import Feature from askui.tools.testing.scenario_models import ( ScenarioCreateParams, ScenarioExample, ScenarioListQuery, ScenarioModifyParams, ScenarioStep, ) from askui.tools.testing.scenario_tools import ( Creat...
"list"
assert
string_literal
tests/integration/tools/testing/test_scenario_tools.py
test_list_scenarios_empty
180
null
askui/python-sdk
from pathlib import Path import pytest from askui.tools.testing.feature_models import Feature from askui.tools.testing.scenario_models import ( ScenarioCreateParams, ScenarioExample, ScenarioListQuery, ScenarioModifyParams, ScenarioStep, ) from askui.tools.testing.scenario_tools import ( Creat...
long_name
assert
variable
tests/integration/tools/testing/test_scenario_tools.py
test_create_scenario_long_name
118
null
curvefi/curve-dao-contracts
import brownie import pytest from brownie import ZERO_ADDRESS def initial_funding(coin_a, vesting_factory): coin_a._mint_for_testing(vesting_factory, 10 ** 21) def test_init_vars(vesting_simple, accounts, coin_a, start_time, end_time): assert vesting_simple.token() ==
coin_a
assert
variable
tests/unitary/VestingEscrowFactory/test_deploy_escrow.py
test_init_vars
84
null
curvefi/curve-dao-contracts
import math import brownie import pytest from brownie import ZERO_ADDRESS, compile_source from tests.conftest import approx REWARD = 10 ** 20 WEEK = 7 * 86400 LP_AMOUNT = 10 ** 18 code = """ # @version 0.2.7 from vyper.interfaces import ERC20 first: address second: address @external def __init__(_first: address,...
REWARD
assert
variable
tests/unitary/RewardsOnlyGauge/test_claim_rewards_multiple.py
test_claim_for_other
105
null
curvefi/curve-dao-contracts
import brownie import pytest from brownie import ZERO_ADDRESS from tests.conftest import approx REWARD = 10 ** 20 WEEK = 7 * 86400 LP_AMOUNT = 10 ** 18 def reward_contract_2(CurveRewards, mock_lp_token, accounts, coin_a): contract = CurveRewards.deploy(mock_lp_token, coin_a, {"from": accounts[0]}) contract.s...
REWARD
assert
variable
tests/unitary/LiquidityGaugeV3/test_set_rewards_deposit.py
test_unsetting_claims
64
null
curvefi/curve-dao-contracts
import pytest def test_approve(gauge_wrapper, accounts): gauge_wrapper.approve(accounts[1], 10 ** 19, {"from": accounts[0]}) assert gauge_wrapper.allowance(accounts[0], accounts[1]) ==
10 ** 19
assert
complex_expr
tests/unitary/LiquidityGaugeWrapper/test_approve.py
test_approve
14
null
curvefi/curve-dao-contracts
import pytest def test_approve(reward_gauge_wrapper, accounts): reward_gauge_wrapper.approve(accounts[1], 10 ** 19, {"from": accounts[0]}) assert reward_gauge_wrapper.allowance(accounts[0], accounts[1]) ==
10 ** 19
assert
complex_expr
tests/unitary/LiquidityGaugeRewardWrapper/test_approve.py
test_approve
14
null
curvefi/curve-dao-contracts
import pytest def burner(UnderlyingBurner, alice, receiver): yield UnderlyingBurner.deploy(receiver, receiver, alice, alice, {"from": alice}) @pytest.mark.parametrize("token", [i[0] for i in swapped], ids=[i[1] for i in swapped]) @pytest.mark.parametrize("has_balance", (True, False)) def test_burn_swap(MintableTe...
0
assert
numeric_literal
tests/fork/Burners/test_underlying_burner.py
test_burn_swap
60
null
curvefi/curve-dao-contracts
from brownie import ETH_ADDRESS, web3 from brownie.convert import to_bytes from hexbytes import HexBytes WEEK = 86400 * 7 def test_anyswap_root_gauge_transfer_crv(alice, chain, gauge_controller, anyswap_root_gauge, token): gauge_controller.add_type("Test", 10 ** 18, {"from": alice}) gauge_controller.add_gauge...
token
assert
variable
tests/unitary/Sidechain/test_sending_to_bridge.py
test_anyswap_root_gauge_transfer_crv
21
null
curvefi/curve-dao-contracts
import math import brownie import pytest from brownie import ZERO_ADDRESS, compile_source from tests.conftest import approx REWARD = 10 ** 20 WEEK = 7 * 86400 LP_AMOUNT = 10 ** 18 code = """ # @version 0.2.7 from vyper.interfaces import ERC20 first: address second: address @external def __init__(_first: address,...
reward
assert
variable
tests/unitary/LiquidityGaugeV3/test_claim_rewards_multiple.py
test_claim_updates_claimed_reward
84
null
curvefi/curve-dao-contracts
import brownie from brownie import ZERO_ADDRESS, chain from brownie.test import strategy from tests.conftest import approx class StateMachine: st_account = strategy("address", length=5) st_value = strategy("uint64", min_value=10 ** 10) st_time = strategy("uint", max_value=365 * 86400) st_reward = str...
balance
assert
variable
tests/integration/LiquidityGaugeV3/test_reward_distribution.py
invariant_balances
StateMachine
107
null
curvefi/curve-dao-contracts
import brownie import pytest ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" DAY = 86400 owner_functions_mock = """ # @version 0.2.7 aave: public(uint256) donated: public(bool) withdrawn: public(uint256) @payable @external def __default__(): pass @external def set_aave_referral(referral_code: uint2...
True
assert
bool_literal
tests/unitary/CryptoPoolProxy/test_owner_admin_crypto.py
test_donate_fees
100
null
curvefi/curve-dao-contracts
import brownie from brownie import chain from brownie.test import strategy class StateMachine: st_account = strategy("address", length=5) st_value = strategy("uint64") st_time = strategy("uint", max_value=86400 * 365) def __init__(self, accounts, gauge_v3, mock_lp_token): self.accounts = acco...
balance
assert
variable
tests/integration/LiquidityGaugeV3/test_deposits_withdrawals_v3.py
invariant_balances
StateMachine
80
null
curvefi/curve-dao-contracts
import brownie def test_commit_transfer_ownership(gauge_controller, accounts): gauge_controller.commit_transfer_ownership(accounts[1], {"from": accounts[0]}) assert gauge_controller.admin() ==
accounts[0]
assert
complex_expr
tests/unitary/GaugeController/test_gaugecontroller_admin.py
test_commit_transfer_ownership
17
null
curvefi/curve-dao-contracts
import math import pytest from brownie import chain WEEK = 7 * 86400 YEAR = 365 * 86400 @pytest.mark.skip_coverage def test_emissions_against_expected(alice, gauge_controller, liquidity_gauge, root_gauge, token): gauge_controller.add_type("Test", 10 ** 18, {"from": alice}) gauge_controller.add_gauge(liquidit...
token.rate()
assert
func_call
tests/unitary/Sidechain/test_root_checkpoint.py
test_emissions_against_expected
60
null
curvefi/curve-dao-contracts
import pytest @pytest.mark.parametrize("idx", range(5)) def test_initial_approval_is_zero(gauge_v2, accounts, idx): assert gauge_v2.allowance(accounts[0], accounts[idx]) ==
0
assert
numeric_literal
tests/unitary/LiquidityGaugeV2/test_approve.py
test_initial_approval_is_zero
6
null
curvefi/curve-dao-contracts
from brownie import ETH_ADDRESS, web3 from brownie.convert import to_bytes from hexbytes import HexBytes WEEK = 86400 * 7 def test_anyswap_root_gauge_transfer_crv(alice, chain, gauge_controller, anyswap_root_gauge, token): gauge_controller.add_type("Test", 10 ** 18, {"from": alice}) gauge_controller.add_gauge...
amount
assert
variable
tests/unitary/Sidechain/test_sending_to_bridge.py
test_anyswap_root_gauge_transfer_crv
24
null
curvefi/curve-dao-contracts
import brownie WEEK = 7 * 86400 YEAR = 365 * 86400 TYPE_WEIGHTS = [5 * 10 ** 17, 2 * 10 ** 18] GAUGE_WEIGHTS = [2 * 10 ** 18, 10 ** 18, 5 * 10 ** 17] def test_set_gauge_weight(chain, accounts, gauge_controller, gauge): gauge_controller.add_gauge(gauge, 0, {"from": accounts[0]}) gauge_controller.change_gauge_...
10 ** 21
assert
complex_expr
tests/unitary/GaugeController/test_gauges_weights.py
test_set_gauge_weight
71
null
curvefi/curve-dao-contracts
WEEK = 86400 * 7 YEAR = 365 * 86400 def test_rate(accounts, chain, token): assert token.rate() ==
0
assert
numeric_literal
tests/unitary/ERC20CRV/test_inflation_delay.py
test_rate
6
null
curvefi/curve-dao-contracts
import brownie import pytest def setup(accounts, gauge_controller, minter, gauge_v2, token, mock_lp_token): token.set_minter(minter, {"from": accounts[0]}) gauge_controller.add_type(b"Liquidity", 10 ** 10, {"from": accounts[0]}) gauge_controller.add_gauge(gauge_v2, 0, 0, {"from": accounts[0]}) mock_l...
[accounts[0], accounts[1], amount]
assert
collection
tests/unitary/LiquidityGaugeV2/test_transfer.py
test_transfer_event_fires
91
null
curvefi/curve-dao-contracts
from brownie import ( ZERO_ADDRESS, ABurner, BTCBurner, CBurner, Contract, ETHBurner, EuroBurner, FeeDistributor, LPBurner, MetaBurner, PoolProxy, UnderlyingBurner, USDNBurner, YBurner, accounts, chain, history, ) BURNERS = { LPBurner: ["0x075b1bb...
0
assert
numeric_literal
tests/fork/Burners/test_fee_distribution.py
test_fee_distribution
190
null