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
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_request_errors.py
test_error_mesg_in_json
pytest.raises
variable
9
import pytest from mock import Mock from requests import HTTPError def test_error_mesg_in_json(api, response): response.status_code = 400 response.json = Mock(return_value={"error": "here's what went wrong"}) with pytest.raises(
HTTPError)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_formulas.py
test_match__exception
pytest.raises
variable
15
from datetime import date, datetime, timezone from decimal import Decimal from fractions import Fraction import pytest from mock import call from pyairtable import formulas as F from pyairtable import orm from pyairtable.formulas import AND, EQ, GT, GTE, LT, LTE, NE, NOT, OR from pyairtable.testing import fake_meta ...
ValueError)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models.py
test_writable_and_readonly
pytest.raises
variable
39
from typing import List import pytest from pyairtable.models._base import ( AirtableModel, CanDeleteModel, CanUpdateModel, RestfulModel, update_forward_refs, ) def raw_data(): return {"foo": 1, "bar": 2, "baz": 3} def create_instance(api, raw_data): def _creates_instance(**kwargs): ...
ValueError)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_collaborator.py
test_init
pytest.raises
variable
18
import pytest from pyairtable.models import Collaborator fake_user_data = { "id": "usr000000fakeuser", "email": "fake@example.com", "name": "Fake User", } def test_init(): c = Collaborator(id="usrXXXXXXXXXXXXX") assert c.id == "usrXXXXXXXXXXXXX" assert c.email is None assert c.name is Non...
ValueError)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_webhook.py
test_notification_from_request
pytest.raises
variable
36
import datetime import json import math from operator import attrgetter import pytest import pyairtable.models.webhook from pyairtable.models.webhook import Webhook, WebhookNotification, WebhookPayload def webhook(sample_json, base, api): webhook_json = sample_json("Webhook") return Webhook.from_api(webhook_...
ValueError)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_orm_model.py
test_model_missing_meta_attribute
pytest.raises
variable
21
from functools import partial from unittest import mock import pytest from requests_mock import Mocker from pyairtable.orm import Model from pyairtable.orm import fields as f from pyairtable.testing import fake_id, fake_meta, fake_record def no_requests(requests_mock): """ Fail if any tests in this module tr...
ValueError)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_enterprise.py
test_audit_log__sortorder
assert
variable
106
import datetime from unittest.mock import Mock, call, patch import pytest from pyairtable.api.enterprise import ( ClaimUsersResponse, DeleteUsersResponse, Enterprise, ) from pyairtable.models.schema import EnterpriseInfo, UserGroup, UserInfo from pyairtable.testing import fake_id def enterprise(api): ...
offset_field
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_orm.py
test_every_field
assert
collection
69
from datetime import datetime import pytest from pyairtable.orm import Model from pyairtable.orm import fields as f from pyairtable.testing import fake_meta pytestmark = [pytest.mark.integration] def _model_fixture(cls, monkeypatch, make_meta): monkeypatch.setattr(cls, "Meta", make_meta(cls.__name__.replace("_"...
[]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_base.py
test_shares
assert
collection
17
import datetime import pytest from requests import HTTPError from pyairtable import Base, Table from pyairtable.testing import fake_id def mock_tables_endpoint(base, requests_mock, sample_json): return requests_mock.get(base.meta_url("tables"), json=sample_json("BaseSchema")) def test_shares(base: Base, request...
[]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_orm_fields.py
test_type_validation_LinkField
assert
collection
47
import datetime import operator import re from unittest import mock import pytest from pyairtable.orm import fields as f from pyairtable.orm.model import Model from pyairtable.testing import ( fake_attachment, fake_id, fake_meta, fake_record, fake_user, ) DATE_S = "2023-01-01" DATE_V = datetime.d...
[]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_api.py
test_create_base
assert_*
collection
18
from unittest import mock import pytest from pyairtable import Api, Base, Table # noqa def mock_bases_endpoint(api, requests_mock, sample_json): return requests_mock.get(api.build_url("meta/bases"), json=sample_json("Bases")) def test_create_base(api): """ Test that Api.create_base is a passthrough to ...
[])
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_table.py
test_chunk
assert
collection
32
from posixpath import join as urljoin from unittest import mock import pytest from requests import Request from requests_mock import Mocker from pyairtable import Api, Base, Table from pyairtable.formulas import AND, EQ, Field from pyairtable.metadata import get_table_schema from pyairtable.models.schema import Table...
[3]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_formulas.py
test_compound_equivalence
assert
collection
18
from datetime import date, datetime, timezone from decimal import Decimal from fractions import Fraction import pytest from mock import call from pyairtable import formulas as F from pyairtable import orm from pyairtable.formulas import AND, EQ, GT, GTE, LT, LTE, NE, NOT, OR from pyairtable.testing import fake_meta ...
[1]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_api.py
test_get_records_options
assert
collection
21
from datetime import datetime, timezone from uuid import uuid4 import pytest from pyairtable import Table from pyairtable import formulas as fo from pyairtable.utils import attachment, date_to_iso_str, datetime_to_iso_str pytestmark = [pytest.mark.integration] def test_get_records_options(table: Table, cols): "...
[rec]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_types.py
test_assert_typed_dict__wrong_type
assert_*
collection
14
import pytest from pyairtable._compat import pydantic from pyairtable.api import types as T from pyairtable.testing import fake_attachment, fake_id, fake_record, fake_user def test_assert_typed_dict__wrong_type(): # assert_typed_dict() with a non-dict with pytest.raises(TypeError): T.assert_typed_dict...
[-1])
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_table.py
test_chunk
assert
collection
29
from posixpath import join as urljoin from unittest import mock import pytest from requests import Request from requests_mock import Mocker from pyairtable import Api, Base, Table from pyairtable.formulas import AND, EQ, Field from pyairtable.metadata import get_table_schema from pyairtable.models.schema import Table...
[0, 0]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_table.py
test_chunk
assert
collection
30
from posixpath import join as urljoin from unittest import mock import pytest from requests import Request from requests_mock import Mocker from pyairtable import Api, Base, Table from pyairtable.formulas import AND, EQ, Field from pyairtable.metadata import get_table_schema from pyairtable.models.schema import Table...
[1, 1]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_table.py
test_chunk
assert
collection
31
from posixpath import join as urljoin from unittest import mock import pytest from requests import Request from requests_mock import Mocker from pyairtable import Api, Base, Table from pyairtable.formulas import AND, EQ, Field from pyairtable.metadata import get_table_schema from pyairtable.models.schema import Table...
[2, 2]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_table.py
test_deprecated_constructor
assert
collection
36
from posixpath import join as urljoin from unittest import mock import pytest from requests import Request from requests_mock import Mocker from pyairtable import Api, Base, Table from pyairtable.formulas import AND, EQ, Field from pyairtable.metadata import get_table_schema from pyairtable.models.schema import Table...
(1, 99)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_types.py
test_assert_typed_dict
assert_*
collection
32
import pytest from pyairtable._compat import pydantic from pyairtable.api import types as T from pyairtable.testing import fake_attachment, fake_id, fake_record, fake_user @pytest.mark.parametrize( "cls,value", [ (T.AttachmentDict, fake_attachment()), (T.BarcodeDict, {"type": "upc", "text": "0...
[value])
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_enterprise.py
test_audit_log__sortorder
assert
collection
105
import datetime from unittest.mock import Mock, call, patch import pytest from pyairtable.api.enterprise import ( ClaimUsersResponse, DeleteUsersResponse, Enterprise, ) from pyairtable.models.schema import EnterpriseInfo, UserGroup, UserInfo from pyairtable.testing import fake_id def enterprise(api): ...
[sortorder]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_types.py
test_assert_typed_dict
assert_*
collection
35
import pytest from pyairtable._compat import pydantic from pyairtable.api import types as T from pyairtable.testing import fake_attachment, fake_id, fake_record, fake_user @pytest.mark.parametrize( "cls,value", [ (T.AttachmentDict, fake_attachment()), (T.BarcodeDict, {"type": "upc", "text": "0...
[value, -1])
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_webhook.py
test_toggle_notifications
assert
collection
31
import datetime import json import math from operator import attrgetter import pytest import pyairtable.models.webhook from pyairtable.models.webhook import Webhook, WebhookNotification, WebhookPayload def webhook(sample_json, base, api): webhook_json = sample_json("Webhook") return Webhook.from_api(webhook_...
{"enable": expected}
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_utils.py
test_attachment
assert
collection
12
from datetime import date, datetime, timezone from functools import partial import pytest from pyairtable import utils utc_tz = partial(datetime, tzinfo=timezone.utc) def test_attachment(): assert utils.attachment("https://url.com") ==
{"url": "https://url.com"}
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_webhooks.py
test_webhook
assert
collection
45
import pytest from pyairtable import Base, Table pytestmark = [pytest.mark.integration] def delete_webhooks_after_itest(base): """ Ensure that we always delete webhooks, even if a test fails. """ try: yield finally: for webhook in base.webhooks(): webhook.delete() def...
{cols.TEXT_ID: "Hey there!"}
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_metadata.py
test_base_schema
assert
collection
12
import pytest import requests from pyairtable import Api, Base, Table from pyairtable.metadata import get_api_bases, get_base_schema, get_table_schema pytestmark = [pytest.mark.integration] def test_base_schema(base: Base, table_name: str): schema = base.schema() assert table_name in
[t.name for t in schema.tables]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_metadata.py
test_table_schema
assert
collection
12
import pytest import requests from pyairtable import Api, Base, Table from pyairtable.metadata import get_api_bases, get_base_schema, get_table_schema pytestmark = [pytest.mark.integration] def test_table_schema(base: Base, table_name: str, cols): schema = base.table(table_name).schema() assert cols.TEXT in...
[f.name for f in schema.fields]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_metadata.py
test_deprecated_get_api_bases
assert
collection
13
import pytest import requests from pyairtable import Api, Base, Table from pyairtable.metadata import get_api_bases, get_base_schema, get_table_schema pytestmark = [pytest.mark.integration] def test_deprecated_get_api_bases(base: Base, base_name: str): with pytest.warns(DeprecationWarning): rv = get_api_...
[b["name"] for b in rv["bases"]]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_comment.py
test_table_comments
assert
collection
58
import datetime import pytest from pyairtable.models import Comment from pyairtable.testing import fake_id, fake_user RECORD_ID = "recHasSomeComments" NOW = datetime.datetime.now().isoformat() def comment_json(): author = fake_user("author") mentioned = fake_user("mentioned") return { "author": ...
["comFake1", "comFake2", "comFake3"]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_webhook.py
test_payloads
assert
collection
94
import datetime import json import math from operator import attrgetter import pytest import pyairtable.models.webhook from pyairtable.models.webhook import Webhook, WebhookNotification, WebhookPayload def webhook(sample_json, base, api): webhook_json = sample_json("Webhook") return Webhook.from_api(webhook_...
[[str(n)] for n in test_case["expect_cursors"]]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_metadata.py
test_deprecated_get_base_schema
assert
collection
13
import pytest import requests from pyairtable import Api, Base, Table from pyairtable.metadata import get_api_bases, get_base_schema, get_table_schema pytestmark = [pytest.mark.integration] def test_deprecated_get_base_schema(base: Base): with pytest.warns(DeprecationWarning): rv = get_base_schema(base) ...
[ "Address", "Contact", "EVERYTHING", "TEST_TABLE", ]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_utils.py
test_attachment
assert
collection
13
from datetime import date, datetime, timezone from functools import partial import pytest from pyairtable import utils utc_tz = partial(datetime, tzinfo=timezone.utc) def test_attachment(): assert utils.attachment("https://url.com") == {"url": "https://url.com"} assert utils.attachment("https://url.com", f...
{ "url": "https://url.com", "filename": "test.jpg", }
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_workspace.py
test_move_base
assert
collection
39
import pytest from pyairtable.api.base import Base from pyairtable.api.workspace import Workspace def workspace_id(): return "wspFakeWorkspaceId" def workspace(api, workspace_id): return Workspace(api, workspace_id) def mock_info(workspace, requests_mock, sample_json): return requests_mock.get(workspace...
{ "baseId": base_id, "targetWorkspaceId": workspace_id, **expected, }
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_formulas.py
test_comparison_equivalence
assert
func_call
15
from datetime import date, datetime, timezone from decimal import Decimal from fractions import Fraction import pytest from mock import call from pyairtable import formulas as F from pyairtable import orm from pyairtable.formulas import AND, EQ, GT, GTE, LT, LTE, NE, NOT, OR from pyairtable.testing import fake_meta ...
EQ(1, 1)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_formulas.py
test_comparison_equivalence
assert
func_call
16
from datetime import date, datetime, timezone from decimal import Decimal from fractions import Fraction import pytest from mock import call from pyairtable import formulas as F from pyairtable import orm from pyairtable.formulas import AND, EQ, GT, GTE, LT, LTE, NE, NOT, OR from pyairtable.testing import fake_meta ...
EQ(2, 1)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_formulas.py
test_comparison_equivalence
assert
func_call
17
from datetime import date, datetime, timezone from decimal import Decimal from fractions import Fraction import pytest from mock import call from pyairtable import formulas as F from pyairtable import orm from pyairtable.formulas import AND, EQ, GT, GTE, LT, LTE, NE, NOT, OR from pyairtable.testing import fake_meta ...
NE(1, 1)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_types.py
test_assert_typed_dict__wrong_type
assert_*
func_call
17
import pytest from pyairtable._compat import pydantic from pyairtable.api import types as T from pyairtable.testing import fake_attachment, fake_id, fake_record, fake_user def test_assert_typed_dict__wrong_type(): # assert_typed_dict() with a non-dict with pytest.raises(TypeError): T.assert_typed_dict...
object())
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_enterprise.py
test_users
assert
func_call
47
import os import uuid import pytest from requests import HTTPError import pyairtable pytestmark = [pytest.mark.integration] def enterprise(api): try: return api.enterprise(os.environ["AIRTABLE_ENTERPRISE_ID"]) except KeyError: pytest.skip("test requires AIRTABLE_ENTERPRISE_ID") def workspac...
set(user_ids)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_orm_model.py
test_from_ids__no_fetch
assert
func_call
23
from functools import partial from unittest import mock import pytest from requests_mock import Mocker from pyairtable.orm import Model from pyairtable.orm import fields as f from pyairtable.testing import fake_id, fake_meta, fake_record def no_requests(requests_mock): """ Fail if any tests in this module tr...
set(fake_ids)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_api.py
test_repr
assert
func_call
12
from unittest import mock import pytest from pyairtable import Api, Base, Table # noqa def mock_bases_endpoint(api, requests_mock, sample_json): return requests_mock.get(api.build_url("meta/bases"), json=sample_json("Bases")) def test_repr(api): assert "Api" in
api.__repr__()
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_enterprise.py
test_user
assert
func_call
45
import os import uuid import pytest from requests import HTTPError import pyairtable pytestmark = [pytest.mark.integration] def enterprise(api): try: return api.enterprise(os.environ["AIRTABLE_ENTERPRISE_ID"]) except KeyError: pytest.skip("test requires AIRTABLE_ENTERPRISE_ID") def workspac...
enterprise.user(user_id).id
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_webhook.py
test_payloads
assert
func_call
89
import datetime import json import math from operator import attrgetter import pytest import pyairtable.models.webhook from pyairtable.models.webhook import Webhook, WebhookNotification, WebhookPayload def webhook(sample_json, base, api): webhook_json = sample_json("Webhook") return Webhook.from_api(webhook_...
len(test_case["expect_numbers"])
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_orm_model.py
test_model_comment_method
assert_*
complex_expr
34
from functools import partial from unittest import mock import pytest from requests_mock import Mocker from pyairtable.orm import Model from pyairtable.orm import fields as f from pyairtable.testing import fake_id, fake_meta, fake_record def no_requests(requests_mock): """ Fail if any tests in this module tr...
*args)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_table.py
test_deprecated_constructor
assert
complex_expr
37
from posixpath import join as urljoin from unittest import mock import pytest from requests import Request from requests_mock import Mocker from pyairtable import Api, Base, Table from pyairtable.formulas import AND, EQ, Field from pyairtable.metadata import get_table_schema from pyairtable.models.schema import Table...
base.id
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_table.py
test_constructor
assert
complex_expr
32
from posixpath import join as urljoin from unittest import mock import pytest from requests import Request from requests_mock import Mocker from pyairtable import Api, Base, Table from pyairtable.formulas import AND, EQ, Field from pyairtable.metadata import get_table_schema from pyairtable.models.schema import Table...
base.api
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_metadata.py
test_table_schema
assert
complex_expr
14
import pytest import requests from pyairtable import Api, Base, Table from pyairtable.metadata import get_api_bases, get_base_schema, get_table_schema pytestmark = [pytest.mark.integration] def test_table_schema(base: Base, table_name: str, cols): schema = base.table(table_name).schema() assert cols.TEXT in ...
cols.TEXT
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_orm.py
test_model_basics
assert
complex_expr
48
import re from datetime import datetime from operator import itemgetter from unittest import mock import pytest from requests_mock import Mocker from pyairtable import Table from pyairtable.orm import Model from pyairtable.orm import fields as f from pyairtable.testing import fake_meta, fake_record def test_model_ba...
contact.id
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_orm.py
test_linked_record
assert
complex_expr
21
import re from datetime import datetime from operator import itemgetter from unittest import mock import pytest from requests_mock import Mocker from pyairtable import Table from pyairtable.orm import Model from pyairtable.orm import fields as f from pyairtable.testing import fake_meta, fake_record def test_linked_r...
address.id
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_metadata.py
test_table_schema
assert
complex_expr
13
import pytest import requests from pyairtable import Api, Base, Table from pyairtable.metadata import get_api_bases, get_base_schema, get_table_schema pytestmark = [pytest.mark.integration] def test_table_schema(base: Base, table_name: str, cols): schema = base.table(table_name).schema() assert cols.TEXT in ...
cols.TEXT_ID
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models.py
test_raw
assert
complex_expr
59
from typing import List import pytest from pyairtable.models._base import ( AirtableModel, CanDeleteModel, CanUpdateModel, RestfulModel, update_forward_refs, ) def raw_data(): return {"foo": 1, "bar": 2, "baz": 3} def create_instance(api, raw_data): def _creates_instance(**kwargs): ...
raw["child"]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_orm_model.py
test_delete
assert_*
complex_expr
22
from functools import partial from unittest import mock import pytest from requests_mock import Mocker from pyairtable.orm import Model from pyairtable.orm import fields as f from pyairtable.testing import fake_id, fake_meta, fake_record def no_requests(requests_mock): """ Fail if any tests in this module tr...
record["id"])
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_orm.py
test_integration_orm
assert
complex_expr
62
from datetime import datetime import pytest from pyairtable.orm import Model from pyairtable.orm import fields as f from pyairtable.testing import fake_meta pytestmark = [pytest.mark.integration] def _model_fixture(cls, monkeypatch, make_meta): monkeypatch.setattr(cls, "Meta", make_meta(cls.__name__.replace("_"...
rv_address.street
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_collaborator.py
test_parse
assert
complex_expr
14
import pytest from pyairtable.models import Collaborator fake_user_data = { "id": "usr000000fakeuser", "email": "fake@example.com", "name": "Fake User", } def test_parse(): user = Collaborator.parse_obj(fake_user_data) assert user.id ==
fake_user_data["id"]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/integration/test_integration_orm.py
test_integration_orm
assert
complex_expr
53
from datetime import datetime import pytest from pyairtable.orm import Model from pyairtable.orm import fields as f from pyairtable.testing import fake_meta pytestmark = [pytest.mark.integration] def _model_fixture(cls, monkeypatch, make_meta): monkeypatch.setattr(cls, "Meta", make_meta(cls.__name__.replace("_"...
contact.address[0].id
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_retrying.py
test_retry_during_iterate
assert
complex_expr
60
import json import threading import time from collections import deque from http import HTTPStatus from urllib.parse import urljoin from wsgiref.simple_server import WSGIRequestHandler, make_server import pytest import requests from pyairtable.api import Api from pyairtable.api.retrying import retry_strategy from pya...
page_count * per_page
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_comment.py
test_table_comments
assert
complex_expr
59
import datetime import pytest from pyairtable.models import Comment from pyairtable.testing import fake_id, fake_user RECORD_ID = "recHasSomeComments" NOW = datetime.datetime.now().isoformat() def comment_json(): author = fake_user("author") mentioned = fake_user("mentioned") return { "author": ...
comments[0].mentioned
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_collaborator.py
test_parse
assert
complex_expr
16
import pytest from pyairtable.models import Collaborator fake_user_data = { "id": "usr000000fakeuser", "email": "fake@example.com", "name": "Fake User", } def test_parse(): user = Collaborator.parse_obj(fake_user_data) assert user.id == fake_user_data["id"] assert user.email == fake_user_data...
fake_user_data["name"]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_collaborator.py
test_parse
assert
complex_expr
15
import pytest from pyairtable.models import Collaborator fake_user_data = { "id": "usr000000fakeuser", "email": "fake@example.com", "name": "Fake User", } def test_parse(): user = Collaborator.parse_obj(fake_user_data) assert user.id == fake_user_data["id"] assert user.email ==
fake_user_data["email"]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_types.py
test_assert_not_typed_dict
pytest.raises
complex_expr
26
import pytest from pyairtable._compat import pydantic from pyairtable.api import types as T from pyairtable.testing import fake_attachment, fake_id, fake_record, fake_user @pytest.mark.parametrize( "cls,value", [ (T.AttachmentDict, {}), (T.BarcodeDict, {"type": "upc"}), (T.ButtonDict, ...
pydantic.ValidationError)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_webhook.py
test_payloads
assert
complex_expr
90
import datetime import json import math from operator import attrgetter import pytest import pyairtable.models.webhook from pyairtable.models.webhook import Webhook, WebhookNotification, WebhookPayload def webhook(sample_json, base, api): webhook_json = sample_json("Webhook") return Webhook.from_api(webhook_...
test_case["expect_numbers"]
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_retrying.py
test_without_retry_strategy__fail
pytest.raises
complex_expr
56
import json import threading import time from collections import deque from http import HTTPStatus from urllib.parse import urljoin from wsgiref.simple_server import WSGIRequestHandler, make_server import pytest import requests from pyairtable.api import Api from pyairtable.api.retrying import retry_strategy from pya...
requests.exceptions.HTTPError)
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_api_enterprise.py
test_info
assert
bool_literal
86
import datetime from unittest.mock import Mock, call, patch import pytest from pyairtable.api.enterprise import ( ClaimUsersResponse, DeleteUsersResponse, Enterprise, ) from pyairtable.models.schema import EnterpriseInfo, UserGroup, UserInfo from pyairtable.testing import fake_id def enterprise(api): ...
True
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_comment.py
test_delete
assert
bool_literal
46
import datetime import pytest from pyairtable.models import Comment from pyairtable.testing import fake_id, fake_user RECORD_ID = "recHasSomeComments" NOW = datetime.datetime.now().isoformat() def comment_json(): author = fake_user("author") mentioned = fake_user("mentioned") return { "author": ...
True
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
gtalarico/pyairtable
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
train
train
tests/test_models_webhook.py
test_error_payload
assert
bool_literal
22
import datetime import json import math from operator import attrgetter import pytest import pyairtable.models.webhook from pyairtable.models.webhook import Webhook, WebhookNotification, WebhookPayload def webhook(sample_json, base, api): webhook_json = sample_json("Webhook") return Webhook.from_api(webhook_...
True
3b06244295a54ea997321ff8d26dcc1e2a15d3d8
152
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/action/test_hacs_action_integration.py
test_hacs_action_integration
assert
complex_expr
65
import base64 import json import os from unittest import mock import pytest from tests.common import TOKEN, MockedResponse, ResponseMocker, current_function_name from tests.conftest import SnapshotFixture @pytest.mark.parametrize( "key,manifest,succeed", ( ("bad_documentation", {"documentation": None...
caplog.text
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/action/test_hacs_action_integration.py
test_hacs_action_integration
assert_*
string_literal
69
import base64 import json import os from unittest import mock import pytest from tests.common import TOKEN, MockedResponse, ResponseMocker, current_function_name from tests.conftest import SnapshotFixture @pytest.mark.parametrize( "key,manifest,succeed", ( ("bad_documentation", {"documentation": None...
f"action/{current_function_name()}/{key}.log")
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/common.py
_create_client
assert
string_literal
556
from __future__ import annotations import asyncio from collections.abc import AsyncGenerator, Mapping, Sequence from contextlib import asynccontextmanager, contextmanager from contextvars import ContextVar import functools as ft from inspect import currentframe import json as json_func import os from types import None...
"auth_ok"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/common.py
_create_client
assert
string_literal
552
from __future__ import annotations import asyncio from collections.abc import AsyncGenerator, Mapping, Sequence from contextlib import asynccontextmanager, contextmanager from contextvars import ContextVar import functools as ft from inspect import currentframe import json as json_func import os from types import None...
"auth_required"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/conftest.py
setup_integration
assert
numeric_literal
284
from . import patch_time # noqa: F401, isort:skip import asyncio from collections import OrderedDict from dataclasses import asdict from glob import iglob import json import logging import os import shutil from typing import Any, Generator from unittest.mock import MagicMock, patch from _pytest.assertion.util import ...
0
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/conftest.py
setup_integration
assert
numeric_literal
281
from . import patch_time # noqa: F401, isort:skip import asyncio from collections import OrderedDict from dataclasses import asdict from glob import iglob import json import logging import os import shutil from typing import Any, Generator from unittest.mock import MagicMock, patch from _pytest.assertion.util import ...
1
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/conftest.py
assert_hacs_data
assert_*
variable
187
from . import patch_time # noqa: F401, isort:skip import asyncio from collections import OrderedDict from dataclasses import asdict from glob import iglob import json import logging import os import shutil from typing import Any, Generator from unittest.mock import MagicMock, patch from _pytest.assertion.util import ...
filename)
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/conftest.py
setup_integration
assert
string_literal
275
from . import patch_time # noqa: F401, isort:skip import asyncio from collections import OrderedDict from dataclasses import asdict from glob import iglob import json import logging import os import shutil from typing import Any, Generator from unittest.mock import MagicMock, patch from _pytest.assertion.util import ...
"report it to the author of the 'hacs' custom integration"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_backup.py
test_netdaemon_backup
assert
string_literal
16
import os from custom_components.hacs.utils.backup import Backup, BackupNetDaemon def test_netdaemon_backup(hacs, repository_netdaemon): repository = repository_netdaemon repository.content.path.local = repository.localpath os.makedirs(repository.content.path.local, exist_ok=True) backup = BackupNetDa...
"test: test"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_backup.py
test_netdaemon_backup
assert
string_literal
25
import os from custom_components.hacs.utils.backup import Backup, BackupNetDaemon def test_netdaemon_backup(hacs, repository_netdaemon): repository = repository_netdaemon repository.content.path.local = repository.localpath os.makedirs(repository.content.path.local, exist_ok=True) backup = BackupNetDa...
"tests: tests"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_configuration.py
test_configuration_and_option
assert
numeric_literal
38
import pytest from custom_components.hacs.base import HacsConfiguration from custom_components.hacs.exceptions import HacsException def test_configuration_and_option(): config = HacsConfiguration() config.update_from_dict({"token": "xxxxxxxxxx"}) assert isinstance(config.to_json(), dict) assert isin...
5
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_configuration.py
test_configuration_and_option
assert
string_literal
35
import pytest from custom_components.hacs.base import HacsConfiguration from custom_components.hacs.exceptions import HacsException def test_configuration_and_option(): config = HacsConfiguration() config.update_from_dict({"token": "xxxxxxxxxx"}) assert isinstance(config.to_json(), dict) assert isin...
"ALL"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_configuration.py
test_configuration_and_option
assert
string_literal
17
import pytest from custom_components.hacs.base import HacsConfiguration from custom_components.hacs.exceptions import HacsException def test_configuration_and_option(): config = HacsConfiguration() config.update_from_dict({"token": "xxxxxxxxxx"}) assert isinstance(config.to_json(), dict) assert isin...
"HACS"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_configuration.py
test_configuration_and_option
assert
string_literal
20
import pytest from custom_components.hacs.base import HacsConfiguration from custom_components.hacs.exceptions import HacsException def test_configuration_and_option(): config = HacsConfiguration() config.update_from_dict({"token": "xxxxxxxxxx"}) assert isinstance(config.to_json(), dict) assert isin...
"hacs:hacs"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_configuration.py
test_configuration_and_option
assert
string_literal
14
import pytest from custom_components.hacs.base import HacsConfiguration from custom_components.hacs.exceptions import HacsException def test_configuration_and_option(): config = HacsConfiguration() config.update_from_dict({"token": "xxxxxxxxxx"}) assert isinstance(config.to_json(), dict) assert isin...
"xxxxxxxxxx"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_configuration.py
test_edge_update_with_none
pytest.raises
variable
9
import pytest from custom_components.hacs.base import HacsConfiguration from custom_components.hacs.exceptions import HacsException def test_edge_update_with_none(): config = HacsConfiguration() with pytest.raises(
HacsException)
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_hacs.py
test_hacs
assert
none_literal
11
import pytest from custom_components.hacs.base import HacsRepositories from custom_components.hacs.enums import HacsCategory async def test_hacs(hacs, repository, tmpdir): hacs.hass.config.config_dir = tmpdir hacs.repositories = HacsRepositories() assert hacs.repositories.get_by_id(None) is
None
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_hacs.py
test_hacs
assert
string_literal
25
import pytest from custom_components.hacs.base import HacsRepositories from custom_components.hacs.enums import HacsCategory async def test_hacs(hacs, repository, tmpdir): hacs.hass.config.config_dir = tmpdir hacs.repositories = HacsRepositories() assert hacs.repositories.get_by_id(None) is None rep...
"1337"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_hacs.py
test_add_remove_repository
assert
variable
22
import pytest from custom_components.hacs.base import HacsRepositories from custom_components.hacs.enums import HacsCategory async def test_add_remove_repository(hacs, repository, tmpdir): hacs.hass.config.config_dir = tmpdir repository.data.id = "0" hacs.repositories.register(repository) hacs.repos...
repository
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_hacs.py
test_hacs
assert
string_literal
18
import pytest from custom_components.hacs.base import HacsRepositories from custom_components.hacs.enums import HacsCategory async def test_hacs(hacs, repository, tmpdir): hacs.hass.config.config_dir = tmpdir hacs.repositories = HacsRepositories() assert hacs.repositories.get_by_id(None) is None rep...
"test/test"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_hacs.py
test_add_remove_repository
pytest.raises
variable
16
import pytest from custom_components.hacs.base import HacsRepositories from custom_components.hacs.enums import HacsCategory async def test_add_remove_repository(hacs, repository, tmpdir): hacs.hass.config.config_dir = tmpdir repository.data.id = "0" hacs.repositories.register(repository) hacs.repos...
ValueError)
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_hacsbase_data.py
test_hacs_data_restore_write_not_new
assert
bool_literal
47
from unittest.mock import patch from custom_components.hacs.base import HacsRepositories from custom_components.hacs.enums import HacsGitHubRepo from custom_components.hacs.utils.data import HacsData async def test_hacs_data_restore_write_not_new(hacs, caplog): data = HacsData(hacs) async def _mocked_loads(h...
True
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/hacsbase/test_hacsbase_data.py
test_hacs_data_restore_write_not_new
assert
complex_expr
53
from unittest.mock import patch from custom_components.hacs.base import HacsRepositories from custom_components.hacs.enums import HacsGitHubRepo from custom_components.hacs.utils.data import HacsData async def test_hacs_data_restore_write_not_new(hacs, caplog): data = HacsData(hacs) async def _mocked_loads(h...
caplog.text
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/handler/test_template.py
test_render_template
assert
string_literal
12
from custom_components.hacs.utils.template import render_template def test_render_template(hacs, repository): content = "ABC" render_template(hacs, content, repository) repository.releases.last_release_object = MockRelease() render_template(hacs, content, repository) hacs.configuration.experimenta...
"hi"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/handler/test_template.py
test_render_template
assert
string_literal
11
from custom_components.hacs.utils.template import render_template def test_render_template(hacs, repository): content = "ABC" render_template(hacs, content, repository) repository.releases.last_release_object = MockRelease() render_template(hacs, content, repository) hacs.configuration.experimenta...
"{{test.test}}"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/handler/test_template.py
test_render_template
assert
string_literal
15
from custom_components.hacs.utils.template import render_template def test_render_template(hacs, repository): content = "ABC" render_template(hacs, content, repository) repository.releases.last_release_object = MockRelease() render_template(hacs, content, repository) hacs.configuration.experimenta...
"{%if True%}hi{%endif%}"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/helpers/classes/test_repository_data.py
test_guarded
assert
string_literal
9
from custom_components.hacs.repositories.base import RepositoryData def test_guarded(): data = RepositoryData.create_from_dict({"full_name": "test"}) assert data.name == "test" data.update_data({"name": "new"}) assert data.name !=
"new"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/helpers/classes/test_repository_data.py
test_guarded
assert
string_literal
6
from custom_components.hacs.repositories.base import RepositoryData def test_guarded(): data = RepositoryData.create_from_dict({"full_name": "test"}) assert data.name ==
"test"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/helpers/download/test_gather_files_to_download.py
test_gather_files_to_download
assert
variable
13
from aiogithubapi.models.release import GitHubReleaseModel from aiogithubapi.objects.repository.content import AIOGitHubAPIRepositoryTreeContent def test_gather_files_to_download(repository): repository.content.path.remote = "" repository.tree = [ AIOGitHubAPIRepositoryTreeContent( {"path":...
files
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/helpers/filters/test_filter_content_return_one_of_type.py
test_valid_objects
assert
variable
22
from aiogithubapi.objects.repository.content import AIOGitHubAPIRepositoryTreeContent from custom_components.hacs.utils import filters def test_valid_objects(): tree = [ AIOGitHubAPIRepositoryTreeContent( {"path": "test/file.file", "type": "blob"}, "test/test", "main" ), AIOGit...
files
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/helpers/filters/test_get_first_directory_in_directory.py
test_not_valid
assert
none_literal
12
from aiogithubapi.objects.repository.content import AIOGitHubAPIRepositoryTreeContent from custom_components.hacs.utils import filters def test_not_valid(): tree = [ AIOGitHubAPIRepositoryTreeContent( {"path": ".github/path/file.file", "type": "tree"}, "test/test", "main" ) ] ...
None
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/helpers/filters/test_get_first_directory_in_directory.py
test_valid
assert
string_literal
16
from aiogithubapi.objects.repository.content import AIOGitHubAPIRepositoryTreeContent from custom_components.hacs.utils import filters def test_valid(): tree = [ AIOGitHubAPIRepositoryTreeContent({"path": "test", "type": "tree"}, "test/test", "main"), AIOGitHubAPIRepositoryTreeContent( ...
"path"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/helpers/functions/test_extract_repository_from_url.py
test_extract_repository_from_url
assert
string_literal
6
from custom_components.hacs.utils import regex def test_extract_repository_from_url(): """Tests for repository extraction.""" assert regex.extract_repository_from_url("https://github.com/user/repo") ==
"user/repo"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/integration/test_integration_setup.py
test_integration_setup_with_custom_updater
assert_*
collection
41
import sys from unittest.mock import MagicMock, patch from homeassistant.components.websocket_api import DOMAIN as WEBSOCKET_DOMAIN from homeassistant.core import HomeAssistant import pytest from custom_components.hacs.base import HacsBase from tests.common import create_config_entry, get_hacs from tests.conftest im...
{})
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/integration/test_integration_setup.py
test_integration_setup
assert
string_literal
26
import sys from unittest.mock import MagicMock, patch from homeassistant.components.websocket_api import DOMAIN as WEBSOCKET_DOMAIN from homeassistant.core import HomeAssistant import pytest from custom_components.hacs.base import HacsBase from tests.common import create_config_entry, get_hacs from tests.conftest im...
"running"
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor
hacs/integration
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
train
train
tests/integration/test_integration_setup.py
test_integration_setup_with_custom_updater
assert
complex_expr
36
import sys from unittest.mock import MagicMock, patch from homeassistant.components.websocket_api import DOMAIN as WEBSOCKET_DOMAIN from homeassistant.core import HomeAssistant import pytest from custom_components.hacs.base import HacsBase from tests.common import create_config_entry, get_hacs from tests.conftest im...
caplog.text
81e13db5a3ffd12e94d0a966bfeba3c30584205d
233
v2_extractor_at_anchor