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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/weatherapi_test.py | test_dispatch_api_key_connection | assert | numeric_literal | 47 | from datetime import datetime, timedelta, timezone
from typing import Dict
import pytest
from pytest_mock import MockerFixture
from requests import Session
from requests_mock.mocker import Mocker
from shillelagh.adapters.api.weatherapi import WeatherAPI, combine_time_filters
from shillelagh.backends.apsw.db import co... | 1 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/weatherapi_test.py | test_dispatch_impossible | assert | numeric_literal | 45 | from datetime import datetime, timedelta, timezone
from typing import Dict
import pytest
from pytest_mock import MockerFixture
from requests import Session
from requests_mock.mocker import Mocker
from shillelagh.adapters.api.weatherapi import WeatherAPI, combine_time_filters
from shillelagh.backends.apsw.db import co... | 0 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/weatherapi_test.py | test_window | assert | numeric_literal | 29 | from datetime import datetime, timedelta, timezone
from typing import Dict
import pytest
from pytest_mock import MockerFixture
from requests import Session
from requests_mock.mocker import Mocker
from shillelagh.adapters.api.weatherapi import WeatherAPI, combine_time_filters
from shillelagh.backends.apsw.db import co... | 7 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/file/csvfile_test.py | test_csvfile_get_cost | assert | numeric_literal | 41 | from datetime import datetime, timezone
from pathlib import Path
import apsw
import pytest
from freezegun import freeze_time
from pyfakefs.fake_filesystem import FakeFilesystem
from requests_mock.mocker import Mocker
from shillelagh.adapters.file.csvfile import CSVFile, RowTracker
from shillelagh.backends.apsw.db imp... | 0 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/memory/pandas_test.py | test_adapter_nulls | assert | numeric_literal | 26 | import pandas as pd
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.memory.pandas import PandasMemory, find_dataframe
from shillelagh.backends.apsw.db import connect
from shillelagh.exceptions import ProgrammingError
from shillelagh.fields import Order
from shillelagh.filters import Equal,... | 1 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/memory/pandas_test.py | test_adapter_nulls | assert | numeric_literal | 30 | import pandas as pd
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.memory.pandas import PandasMemory, find_dataframe
from shillelagh.backends.apsw.db import connect
from shillelagh.exceptions import ProgrammingError
from shillelagh.fields import Order
from shillelagh.filters import Equal,... | 0 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/registry_test.py | test_load_error | assert | numeric_literal | 26 | import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.file.csvfile import CSVFile
from shillelagh.adapters.registry import AdapterLoader
from shillelagh.exceptions import InterfaceError
from ..fakes import FakeAdapter
def test_load_error(registry: AdapterLoader) -> None:
"""
Test error... | 2 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/db_test.py | test_connect | assert | numeric_literal | 37 | import datetime
from typing import Any, List, Tuple
from unittest import mock
import apsw
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.registry import AdapterLoader, UnsafeAdaptersError
from shillelagh.backends.apsw.db import Connection, connect, convert_binding
from shillelagh.excepti... | 2 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/db_test.py | test_connect | assert | numeric_literal | 48 | import datetime
from typing import Any, List, Tuple
from unittest import mock
import apsw
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.registry import AdapterLoader, UnsafeAdaptersError
from shillelagh.backends.apsw.db import Connection, connect, convert_binding
from shillelagh.excepti... | 1 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/db_test.py | test_execute_with_native_parameters | assert | numeric_literal | 31 | import datetime
from typing import Any, List, Tuple
from unittest import mock
import apsw
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.registry import AdapterLoader, UnsafeAdaptersError
from shillelagh.backends.apsw.db import Connection, connect, convert_binding
from shillelagh.excepti... | 0 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/dbapi_test.py | test_module_interface | assert | numeric_literal | 17 | from inspect import isfunction, ismethod
import pytest
from shillelagh.backends.apsw import db as dbapi
def test_module_interface() -> None:
"""
Test constructors, globals, and exceptions.
"""
# constructors
assert isfunction(dbapi.connect)
# globals
assert dbapi.apilevel == "2.0"
a... | 2 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/dbapi_test.py | test_cursor | assert | numeric_literal | 23 | from inspect import isfunction, ismethod
import pytest
from shillelagh.backends.apsw import db as dbapi
def test_cursor() -> None:
"""
Test that the cursor implements required methods.
"""
connection = dbapi.connect(":memory:")
cursor = connection.cursor()
# attributes
assert cursor.desc... | 1 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/dialects/base_test.py | test_create_engine | assert | numeric_literal | 28 | from unittest import mock
import pytest
from sqlalchemy import MetaData, Table, create_engine, func, inspect, select
from shillelagh.adapters.registry import AdapterLoader
from shillelagh.backends.apsw.dialects.base import APSWDialect
from shillelagh.exceptions import ProgrammingError
from ....fakes import FakeAdapt... | 3 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/vt_test.py | test_update_insert_row | assert | numeric_literal | 34 | import datetime
import json
from typing import Any, Dict, Iterable
import apsw
import pytest
from pytest_mock import MockerFixture
from shillelagh.backends.apsw.vt import (
VTModule,
VTTable,
_add_sqlite_constraint,
convert_rows_from_sqlite,
convert_rows_to_sqlite,
get_all_bounds,
get_limi... | 2 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/vt_test.py | test_update_insert_row | assert | numeric_literal | 42 | import datetime
import json
from typing import Any, Dict, Iterable
import apsw
import pytest
from pytest_mock import MockerFixture
from shillelagh.backends.apsw.vt import (
VTModule,
VTTable,
_add_sqlite_constraint,
convert_rows_from_sqlite,
convert_rows_to_sqlite,
get_all_bounds,
get_limi... | 4 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/vt_test.py | test_cursor | assert | numeric_literal | 34 | import datetime
import json
from typing import Any, Dict, Iterable
import apsw
import pytest
from pytest_mock import MockerFixture
from shillelagh.backends.apsw.vt import (
VTModule,
VTTable,
_add_sqlite_constraint,
convert_rows_from_sqlite,
convert_rows_to_sqlite,
get_all_bounds,
get_limi... | 0 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/vt_test.py | test_get_limit_offset | assert | numeric_literal | 39 | import datetime
import json
from typing import Any, Dict, Iterable
import apsw
import pytest
from pytest_mock import MockerFixture
from shillelagh.backends.apsw.vt import (
VTModule,
VTTable,
_add_sqlite_constraint,
convert_rows_from_sqlite,
convert_rows_to_sqlite,
get_all_bounds,
get_limi... | 5 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/fields_test.py | test_integer | assert | numeric_literal | 45 | import datetime
import decimal
import sys
from typing import Union
import pytest
from shillelagh.adapters.registry import registry
from shillelagh.backends.apsw.db import connect
from shillelagh.exceptions import ProgrammingError
from shillelagh.fields import (
Blob,
Boolean,
Date,
DateTime,
FastI... | 1 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/fields_test.py | test_int_boolean | assert | numeric_literal | 50 | import datetime
import decimal
import sys
from typing import Union
import pytest
from shillelagh.adapters.registry import registry
from shillelagh.backends.apsw.db import connect
from shillelagh.exceptions import ProgrammingError
from shillelagh.fields import (
Blob,
Boolean,
Date,
DateTime,
FastI... | 0 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/filters_test.py | test_range | assert | numeric_literal | 30 | import pytest
from shillelagh.filters import (
Endpoint,
Equal,
Impossible,
IsNotNull,
IsNull,
Like,
NotEqual,
Operator,
Range,
Side,
)
def test_range() -> None:
"""
Test ``Range``.
"""
operations = {
(Operator.GT, 0),
(Operator.LT, 10),
... | 2 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/filters_test.py | test_range | assert | numeric_literal | 31 | import pytest
from shillelagh.filters import (
Endpoint,
Equal,
Impossible,
IsNotNull,
IsNull,
Like,
NotEqual,
Operator,
Range,
Side,
)
def test_range() -> None:
"""
Test ``Range``.
"""
operations = {
(Operator.GT, 0),
(Operator.LT, 10),
... | 4 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/filters_test.py | test_range_equal | assert | numeric_literal | 31 | import pytest
from shillelagh.filters import (
Endpoint,
Equal,
Impossible,
IsNotNull,
IsNull,
Like,
NotEqual,
Operator,
Range,
Side,
)
def test_range_equal() -> None:
"""
Test ``Range`` collapsed to an equality.
"""
operations = {
(Operator.GT, 0),
... | 3 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/filters_test.py | test_impossible | assert | numeric_literal | 23 | import pytest
from shillelagh.filters import (
Endpoint,
Equal,
Impossible,
IsNotNull,
IsNull,
Like,
NotEqual,
Operator,
Range,
Side,
)
def test_impossible() -> None:
"""
Test ``Impossible``.
"""
assert Impossible.build([]) == Impossible() # type: ignore
as... | 0 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/filters_test.py | test_endpoints | assert | numeric_literal | 60 | import pytest
from shillelagh.filters import (
Endpoint,
Equal,
Impossible,
IsNotNull,
IsNull,
Like,
NotEqual,
Operator,
Range,
Side,
)
def build_endpoint(representation: str) -> Endpoint:
"""
Function to build an endpoint.
"""
if representation[0] in {"(", "["}... | 1 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/lib_test.py | test_analyze | assert | numeric_literal | 73 | from typing import Any, Dict, Iterator, List, Tuple
import pytest
from pytest_mock import MockerFixture
from shillelagh.exceptions import ImpossibleFilterError, ProgrammingError
from shillelagh.fields import Boolean, Field, Float, Integer, Order, String
from shillelagh.filters import (
Equal,
Filter,
Impo... | 3 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/gsheets/lib_test.py | test_get_index_from_letters | assert | numeric_literal | 39 | import itertools
from typing import List, cast
import dateutil.tz
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.api.gsheets.fields import (
GSheetsBoolean,
GSheetsDate,
GSheetsDateTime,
GSheetsNumber,
GSheetsString,
GSheetsTime,
)
from shillelagh.adapters.api.gsh... | 25 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/gsheets/lib_test.py | test_get_index_from_letters | assert | numeric_literal | 40 | import itertools
from typing import List, cast
import dateutil.tz
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.api.gsheets.fields import (
GSheetsBoolean,
GSheetsDate,
GSheetsDateTime,
GSheetsNumber,
GSheetsString,
GSheetsTime,
)
from shillelagh.adapters.api.gsh... | 26 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/gsheets/lib_test.py | test_get_index_from_letters | assert | numeric_literal | 41 | import itertools
from typing import List, cast
import dateutil.tz
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.api.gsheets.fields import (
GSheetsBoolean,
GSheetsDate,
GSheetsDateTime,
GSheetsNumber,
GSheetsString,
GSheetsTime,
)
from shillelagh.adapters.api.gsh... | 27 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/weatherapi_test.py | test_integration | assert | numeric_literal | 46 | from datetime import datetime, timedelta, timezone
from typing import Dict
import pytest
from pytest_mock import MockerFixture
from requests import Session
from requests_mock.mocker import Mocker
from shillelagh.adapters.api.weatherapi import WeatherAPI, combine_time_filters
from shillelagh.backends.apsw.db import co... | 31 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/weatherapi_test.py | test_window | assert | numeric_literal | 34 | from datetime import datetime, timedelta, timezone
from typing import Dict
import pytest
from pytest_mock import MockerFixture
from requests import Session
from requests_mock.mocker import Mocker
from shillelagh.adapters.api.weatherapi import WeatherAPI, combine_time_filters
from shillelagh.backends.apsw.db import co... | 14 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/dbapi_test.py | test_cursor | assert | numeric_literal | 17 | from inspect import isfunction, ismethod
import pytest
from shillelagh.backends.apsw import db as dbapi
def test_cursor() -> None:
"""
Test that the cursor implements required methods.
"""
connection = dbapi.connect(":memory:")
cursor = connection.cursor()
# attributes
assert cursor.desc... | -1 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/vt_test.py | test_virtual_best_index_object | assert | numeric_literal | 65 | import datetime
import json
from typing import Any, Dict, Iterable
import apsw
import pytest
from pytest_mock import MockerFixture
from shillelagh.backends.apsw.vt import (
VTModule,
VTTable,
_add_sqlite_constraint,
convert_rows_from_sqlite,
convert_rows_to_sqlite,
get_all_bounds,
get_limi... | 42 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/vt_test.py | test_cursor | assert | numeric_literal | 35 | import datetime
import json
from typing import Any, Dict, Iterable
import apsw
import pytest
from pytest_mock import MockerFixture
from shillelagh.backends.apsw.vt import (
VTModule,
VTTable,
_add_sqlite_constraint,
convert_rows_from_sqlite,
convert_rows_to_sqlite,
get_all_bounds,
get_limi... | 20 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/backends/apsw/vt_test.py | test_get_limit_offset | assert | numeric_literal | 38 | import datetime
import json
from typing import Any, Dict, Iterable
import apsw
import pytest
from pytest_mock import MockerFixture
from shillelagh.backends.apsw.vt import (
VTModule,
VTTable,
_add_sqlite_constraint,
convert_rows_from_sqlite,
convert_rows_to_sqlite,
get_all_bounds,
get_limi... | 10 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/fields_test.py | test_comparison | assert | numeric_literal | 51 | import datetime
import decimal
import sys
from typing import Union
import pytest
from shillelagh.adapters.registry import registry
from shillelagh.backends.apsw.db import connect
from shillelagh.exceptions import ProgrammingError
from shillelagh.fields import (
Blob,
Boolean,
Date,
DateTime,
FastI... | 42 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/filters_test.py | test_equal | assert | numeric_literal | 24 | import pytest
from shillelagh.filters import (
Endpoint,
Equal,
Impossible,
IsNotNull,
IsNull,
Like,
NotEqual,
Operator,
Range,
Side,
)
def test_equal() -> None:
"""
Test ``Equal``.
"""
operations = {(Operator.EQ, 10)}
filter_ = Equal.build(operations)
a... | 10 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/functions_test.py | test_sleep_from_sql | assert_* | numeric_literal | 26 | import json
import sys
import apsw
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.registry import AdapterLoader
from shillelagh.backends.apsw.db import connect
from shillelagh.exceptions import ProgrammingError
from shillelagh.functions import get_metadata
from .fakes import FakeAdapter... | 5) | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/gsheets/fields_test.py | test_GSheetsNumber | assert | numeric_literal | 23 | import datetime
import dateutil.tz
from shillelagh.adapters.api.gsheets.fields import (
GSheetsBoolean,
GSheetsDate,
GSheetsDateTime,
GSheetsDuration,
GSheetsNumber,
GSheetsString,
GSheetsTime,
)
from shillelagh.fields import ISODateTime, Order
def test_GSheetsNumber() -> None:
"""
... | 1.0 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/gsheets/lib_test.py | test_get_index_from_letters | assert | numeric_literal | 42 | import itertools
from typing import List, cast
import dateutil.tz
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.api.gsheets.fields import (
GSheetsBoolean,
GSheetsDate,
GSheetsDateTime,
GSheetsNumber,
GSheetsString,
GSheetsTime,
)
from shillelagh.adapters.api.gsh... | 702 | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/gsheets/adapter_test.py | test_set_metadata | assert | none_literal | 196 | import datetime
import json
from typing import Any, Iterator, List
from unittest import mock
import apsw
import dateutil.tz
import pytest
import requests
import requests_mock
from pytest_mock import MockerFixture
from shillelagh.adapters.api.gsheets.adapter import GSheetsAPI
from shillelagh.backends.apsw.db import co... | None | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/gsheets/fields_test.py | test_GSheetsDateTime | assert | none_literal | 21 | import datetime
import dateutil.tz
from shillelagh.adapters.api.gsheets.fields import (
GSheetsBoolean,
GSheetsDate,
GSheetsDateTime,
GSheetsDuration,
GSheetsNumber,
GSheetsString,
GSheetsTime,
)
from shillelagh.fields import ISODateTime, Order
def test_GSheetsDateTime() -> None:
"""
... | None | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/gsheets/integration_test.py | test_2_header_sheet | assert | none_literal | 36 | import datetime
from typing import Any, Dict
import pytest
from dateutil.tz import tzoffset
from shillelagh.adapters.api.gsheets.types import SyncMode
from shillelagh.backends.apsw.db import connect
@pytest.mark.skip("Credentials no longer valid")
@pytest.mark.slow_integration_test
@pytest.mark.parametrize("sync_mod... | None | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/gsheets/lib_test.py | test_get_sync_mode | assert | none_literal | 38 | import itertools
from typing import List, cast
import dateutil.tz
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.api.gsheets.fields import (
GSheetsBoolean,
GSheetsDate,
GSheetsDateTime,
GSheetsNumber,
GSheetsString,
GSheetsTime,
)
from shillelagh.adapters.api.gsh... | None | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/api/socrata_test.py | test_number | assert | none_literal | 22 | from datetime import date
import pytest
from pytest_mock import MockerFixture
from requests import Session
from requests_mock.mocker import Mocker
from shillelagh.adapters.api.socrata import Number, SocrataAPI
from shillelagh.backends.apsw.db import connect
from shillelagh.exceptions import ProgrammingError
from shil... | None | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/file/csvfile_test.py | test_supports | assert | none_literal | 48 | from datetime import datetime, timezone
from pathlib import Path
import apsw
import pytest
from freezegun import freeze_time
from pyfakefs.fake_filesystem import FakeFilesystem
from requests_mock.mocker import Mocker
from shillelagh.adapters.file.csvfile import CSVFile, RowTracker
from shillelagh.backends.apsw.db imp... | None | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/memory/pandas_test.py | test_find_dataframe | assert | none_literal | 25 | import pandas as pd
import pytest
from pytest_mock import MockerFixture
from shillelagh.adapters.memory.pandas import PandasMemory, find_dataframe
from shillelagh.backends.apsw.db import connect
from shillelagh.exceptions import ProgrammingError
from shillelagh.fields import Order
from shillelagh.filters import Equal,... | None | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
betodealmeida/shillelagh | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | train | train | tests/adapters/file/csvfile_test.py | test_csvfile_close_not_modified | assert | func_call | 56 | from datetime import datetime, timezone
from pathlib import Path
import apsw
import pytest
from freezegun import freeze_time
from pyfakefs.fake_filesystem import FakeFilesystem
from requests_mock.mocker import Mocker
from shillelagh.adapters.file.csvfile import CSVFile, RowTracker
from shillelagh.backends.apsw.db imp... | datetime(2022, 1, 1, tzinfo=timezone.utc).timestamp() | 6bb3a5c1de910fd76dc8f038f405a8649668185b | 151 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | test_lightning_pay_flow | assert | numeric_literal | 184 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | 1 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | test_payouts | assert | numeric_literal | 201 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | 0 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | test_payouts | assert | numeric_literal | 215 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | 2 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | get_status | assert | numeric_literal | 37 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | 200 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | check_status | assert | variable | 144 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | data | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | apply_batch_payout_action | assert | bool_literal | 162 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | True | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | test_payouts | assert | none_literal | 199 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | None | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | test_onchain_pay_flow | assert | variable | 162 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | speed | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | test_onchain_pay_flow | assert | string_literal | 169 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | "pending" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | test_lightning_pay_flow | assert | string_literal | 188 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | "BTC (⚡)" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | check_status | assert | complex_expr | 145 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | queue_data[1] | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/test_functional.py | check_payout_status | assert | variable | 167 | import asyncio
import signal
from decimal import Decimal
from queue import Queue
import pytest
from aiohttp import web
from bitcart import BTC
from bitcart.utils import bitcoins
from httpx_ws import aconnect_ws
from api.constants import MAX_CONFIRMATION_WATCH
from api.ext.moneyformat import truncate
from tests.functi... | expected_status | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/functional/utils.py | run_shell | assert | numeric_literal | 10 | import os
import subprocess
def run_shell(args=None, timeout=30):
if args is None:
args = []
process = subprocess.Popen(["tests/functional/regtest.sh"] + args, stdout=subprocess.PIPE, universal_newlines=True)
process.wait(timeout=timeout)
assert process.returncode == | 0 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/helper.py | create_model_obj | assert | numeric_literal | 131 | from __future__ import annotations
import json as json_module
import random
from contextlib import contextmanager
from datetime import timedelta
from typing import TYPE_CHECKING
from api import settings, utils
from tests.fixtures import static_data
async def create_user(client: TestClient, **custom_attrs) -> dict:
... | 200 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_events.py | test_add_event_handler | assert | numeric_literal | 21 | from queue import Queue
import pytest
from api import events
def empty_event_handler():
return events.EventHandler()
def event_handler():
return events.EventHandler(events={"test_event": {"params": {"param1", "param2"}, "handlers": []}})
def test_add_event_handler(empty_event_handler, event_handler):
d... | 1 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_events.py | test_add_event_handler | assert | variable | 22 | from queue import Queue
import pytest
from api import events
def empty_event_handler():
return events.EventHandler()
def event_handler():
return events.EventHandler(events={"test_event": {"params": {"param1", "param2"}, "handlers": []}})
def test_add_event_handler(empty_event_handler, event_handler):
d... | func | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_events.py | test_add_event_handler | assert | variable | 32 | from queue import Queue
import pytest
from api import events
def empty_event_handler():
return events.EventHandler()
def event_handler():
return events.EventHandler(events={"test_event": {"params": {"param1", "param2"}, "handlers": []}})
def test_add_event_handler(empty_event_handler, event_handler):
d... | func2 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_events.py | test_process_message | assert | variable | 31 | from queue import Queue
import pytest
from api import events
def empty_event_handler():
return events.EventHandler()
def event_handler():
return events.EventHandler(events={"test_event": {"params": {"param1", "param2"}, "handlers": []}})
@pytest.mark.anyio
async def test_process_message(event_handler):
... | sample_data | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_events.py | test_add_event_handler | assert | complex_expr | 28 | from queue import Queue
import pytest
from api import events
def empty_event_handler():
return events.EventHandler()
def event_handler():
return events.EventHandler(events={"test_event": {"params": {"param1", "param2"}, "handlers": []}})
def test_add_event_handler(empty_event_handler, event_handler):
d... | event_handler.events | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_export.py | test_invoice_db_to_json | assert | numeric_literal | 14 | import io
import pytest
from api import models, utils
from api.ext.export import db_to_json, json_to_csv, merge_keys
@pytest.mark.anyio
async def test_invoice_db_to_json(invoice):
items = await models.Invoice.query.gino.all()
await utils.database.postprocess_func(items)
json = list(db_to_json(items))
... | 1 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_export.py | test_merge_keys | assert | string_literal | 10 | import io
import pytest
from api import models, utils
from api.ext.export import db_to_json, json_to_csv, merge_keys
def test_merge_keys():
assert merge_keys(None, "test") == | "test" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_export.py | test_merge_keys | assert | string_literal | 12 | import io
import pytest
from api import models, utils
from api.ext.export import db_to_json, json_to_csv, merge_keys
def test_merge_keys():
assert merge_keys(None, "test") == "test"
assert merge_keys("test", None) == "test"
assert merge_keys("test", "test") == | "test_test" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_export.py | test_json_to_csv | assert | string_literal | 13 | import io
import pytest
from api import models, utils
from api.ext.export import db_to_json, json_to_csv, merge_keys
def test_json_to_csv():
converted = json_to_csv([{"test": 1, "list": [1, 2, 3], "obj": {"obj2": {"field": 4}}}])
assert isinstance(converted, io.StringIO)
value = converted.getvalue()
... | 'list,obj_obj2_field,test\r\n"[1,2,3]",4,1' | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_ssh.py | test_parse_connection_string | assert | numeric_literal | 21 | import pytest
from api.ext.ssh import parse_connection_string
@pytest.mark.parametrize(
"connection_str,host,port,username",
[
("", "", 22, ""),
("test.com", "test.com", 22, "root"),
("user@test.com", "test.com", 22, "user"),
("test.com:1", "test.com", 1, "root"),
("tes... | 3 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_ssh.py | test_parse_connection_string | assert | variable | 22 | import pytest
from api.ext.ssh import parse_connection_string
@pytest.mark.parametrize(
"connection_str,host,port,username",
[
("", "", 22, ""),
("test.com", "test.com", 22, "root"),
("user@test.com", "test.com", 22, "user"),
("test.com:1", "test.com", 1, "root"),
("tes... | host | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_ssh.py | test_parse_connection_string | assert | variable | 23 | import pytest
from api.ext.ssh import parse_connection_string
@pytest.mark.parametrize(
"connection_str,host,port,username",
[
("", "", 22, ""),
("test.com", "test.com", 22, "root"),
("user@test.com", "test.com", 22, "user"),
("test.com:1", "test.com", 1, "root"),
("tes... | port | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_ssh.py | test_parse_connection_string | assert | variable | 24 | import pytest
from api.ext.ssh import parse_connection_string
@pytest.mark.parametrize(
"connection_str,host,port,username",
[
("", "", 22, ""),
("test.com", "test.com", 22, "root"),
("user@test.com", "test.com", 22, "user"),
("test.com:1", "test.com", 1, "root"),
("tes... | username | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_tor.py | test_parse_hidden_service | assert | string_literal | 21 | import ipaddress
import os
from api.ext.tor import (
HiddenService,
PortDefinition,
get_hostname,
get_service_name,
is_onion,
parse_hidden_service,
parse_hidden_service_port,
parse_torrc,
)
def test_parse_hidden_service():
assert not parse_hidden_service("test")
assert not pars... | "test" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_tor.py | test_get_service_name | assert | string_literal | 17 | import ipaddress
import os
from api.ext.tor import (
HiddenService,
PortDefinition,
get_hostname,
get_service_name,
is_onion,
parse_hidden_service,
parse_hidden_service_port,
parse_torrc,
)
def test_get_service_name():
assert get_service_name("test-1") == | "test 1" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_tor.py | test_get_hostname | assert | string_literal | 19 | import ipaddress
import os
from api.ext.tor import (
HiddenService,
PortDefinition,
get_hostname,
get_service_name,
is_onion,
parse_hidden_service,
parse_hidden_service_port,
parse_torrc,
)
def test_get_hostname(service_dir):
assert not get_hostname("test")
hostname = get_hostn... | "http://test.onion" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_tor.py | test_get_service_name | assert | string_literal | 18 | import ipaddress
import os
from api.ext.tor import (
HiddenService,
PortDefinition,
get_hostname,
get_service_name,
is_onion,
parse_hidden_service,
parse_hidden_service_port,
parse_torrc,
)
def test_get_service_name():
assert get_service_name("test-1") == "test 1"
assert get_s... | "Bitcart Merchants API" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_tor.py | test_parse_hidden_service_port | assert | func_call | 26 | import ipaddress
import os
from api.ext.tor import (
HiddenService,
PortDefinition,
get_hostname,
get_service_name,
is_onion,
parse_hidden_service,
parse_hidden_service_port,
parse_torrc,
)
def test_parse_hidden_service_port():
assert not parse_hidden_service_port("test")
asser... | PortDefinition( 80, str(ipaddress.ip_address("127.0.0.1")), 80 ) | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_ext/test_tor.py | test_parse_torrc | assert | collection | 19 | import ipaddress
import os
from api.ext.tor import (
HiddenService,
PortDefinition,
get_hostname,
get_service_name,
is_onion,
parse_hidden_service,
parse_hidden_service_port,
parse_torrc,
)
def test_parse_torrc(torrc, service_dir):
assert not parse_torrc(None)
assert not parse_... | [ HiddenService( os.path.basename(service_dir), service_dir, "http://test.onion", PortDefinition(80, str(ipaddress.ip_address("127.0.0.1")), 80), ) ] | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_templates.py | test_default_template_render | assert | string_literal | 10 | import pytest
from api import exceptions, templates
def test_default_template_render(notification_template):
template = templates.Template("notification")
assert template.name == "notification"
assert template.template_text == notification_template
assert template.render() == | "" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_templates.py | test_text_template_render | assert | string_literal | 8 | import pytest
from api import exceptions, templates
def test_text_template_render():
template = templates.Template("test", "Hello {{var}}!")
assert template.name == | "test" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_templates.py | test_add_template | assert | variable | 10 | import pytest
from api import exceptions, templates
def test_add_template():
manager = templates.TemplateManager()
template = templates.Template("product")
manager.add_template(template)
assert manager.templates["product"] == | template | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_templates.py | test_text_template_render | assert | string_literal | 10 | import pytest
from api import exceptions, templates
def test_text_template_render():
template = templates.Template("test", "Hello {{var}}!")
assert template.name == "test"
assert template.template_text == "Hello {{var}}!"
assert template.render() == | "Hello !" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_templates.py | test_default_template_render | assert | string_literal | 8 | import pytest
from api import exceptions, templates
def test_default_template_render(notification_template):
template = templates.Template("notification")
assert template.name == | "notification" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_templates.py | test_text_template_render | assert | string_literal | 11 | import pytest
from api import exceptions, templates
def test_text_template_render():
template = templates.Template("test", "Hello {{var}}!")
assert template.name == "test"
assert template.template_text == "Hello {{var}}!"
assert template.render() == "Hello !"
assert template.render(var="world") =... | "Hello world!" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_templates.py | test_text_template_render | assert | string_literal | 9 | import pytest
from api import exceptions, templates
def test_text_template_render():
template = templates.Template("test", "Hello {{var}}!")
assert template.name == "test"
assert template.template_text == | "Hello {{var}}!" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_templates.py | test_default_template_render | assert | variable | 9 | import pytest
from api import exceptions, templates
def test_default_template_render(notification_template):
template = templates.Template("notification")
assert template.name == "notification"
assert template.template_text == | notification_template | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_templates.py | test_unknown_template_render | pytest.raises | complex_expr | 7 | import pytest
from api import exceptions, templates
def test_unknown_template_render():
with pytest.raises( | exceptions.TemplateLoadError) | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_templates.py | test_default_template_render | assert | string_literal | 11 | import pytest
from api import exceptions, templates
def test_default_template_render(notification_template):
template = templates.Template("notification")
assert template.name == "notification"
assert template.template_text == notification_template
assert template.render() == "" # Silent error handli... | "New order from test@test.com for !" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_utils.py | test_make_subscriber | assert | numeric_literal | 45 | import asyncio
import os
import shlex
import subprocess
import time
from dataclasses import dataclass
from datetime import timedelta
from decimal import Decimal
import pytest
from bitcart.errors import BaseError as BitcartBaseError
from fastapi import HTTPException
from redis.asyncio.client import PubSub
from api imp... | 1 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_utils.py | test_broken_coin | assert | numeric_literal | 45 | import asyncio
import os
import shlex
import subprocess
import time
from dataclasses import dataclass
from datetime import timedelta
from decimal import Decimal
import pytest
from bitcart.errors import BaseError as BitcartBaseError
from fastapi import HTTPException
from redis.asyncio.client import PubSub
from api imp... | 8 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_utils.py | test_get_template | assert | string_literal | 45 | import asyncio
import os
import shlex
import subprocess
import time
from dataclasses import dataclass
from datetime import timedelta
from decimal import Decimal
import pytest
from bitcart.errors import BaseError as BitcartBaseError
from fastapi import HTTPException
from redis.asyncio.client import PubSub
from api imp... | "" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_utils.py | test_search_query_parsing | assert | collection | 43 | import asyncio
import os
import shlex
import subprocess
import time
from dataclasses import dataclass
from datetime import timedelta
from decimal import Decimal
import pytest
from bitcart.errors import BaseError as BitcartBaseError
from fastapi import HTTPException
from redis.asyncio.client import PubSub
from api imp... | {} | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_utils.py | test_gen_recovery_code | assert | numeric_literal | 69 | import asyncio
import os
import shlex
import subprocess
import time
from dataclasses import dataclass
from datetime import timedelta
from decimal import Decimal
import pytest
from bitcart.errors import BaseError as BitcartBaseError
from fastapi import HTTPException
from redis.asyncio.client import PubSub
from api imp... | 11 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_utils.py | test_get_template | assert | numeric_literal | 53 | import asyncio
import os
import shlex
import subprocess
import time
from dataclasses import dataclass
from datetime import timedelta
from decimal import Decimal
import pytest
from bitcart.errors import BaseError as BitcartBaseError
from fastapi import HTTPException
from redis.asyncio.client import PubSub
from api imp... | 200 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_utils.py | test_gen_recovery_code | assert | string_literal | 70 | import asyncio
import os
import shlex
import subprocess
import time
from dataclasses import dataclass
from datetime import timedelta
from decimal import Decimal
import pytest
from bitcart.errors import BaseError as BitcartBaseError
from fastapi import HTTPException
from redis.asyncio.client import PubSub
from api imp... | "-" | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_utils.py | test_run_host | assert | bool_literal | 60 | import asyncio
import os
import shlex
import subprocess
import time
from dataclasses import dataclass
from datetime import timedelta
from decimal import Decimal
import pytest
from bitcart.errors import BaseError as BitcartBaseError
from fastapi import HTTPException
from redis.asyncio.client import PubSub
from api imp... | True | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_utils.py | test_run_host | assert | none_literal | 61 | import asyncio
import os
import shlex
import subprocess
import time
from dataclasses import dataclass
from datetime import timedelta
from decimal import Decimal
import pytest
from bitcart.errors import BaseError as BitcartBaseError
from fastapi import HTTPException
from redis.asyncio.client import PubSub
from api imp... | None | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
bitcart/bitcart | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | train | train | tests/test_views/test_model_views.py | check_payments | assert | numeric_literal | 49 | from __future__ import annotations
import json as json_module
from datetime import datetime
from typing import TYPE_CHECKING
import pytest
from api.constants import ID_LENGTH, PUBLIC_ID_LENGTH
pytestmark = pytest.mark.anyio
class TestInvoices(ViewTestMixin):
name = "invoices"
tests = json_module.loads(open... | 1 | 53b7c4532aa6ab59f4dc189b7367021c772682df | 143 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.