repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
joke2k/faker | import re
import string
from collections import OrderedDict
import pytest
from faker.providers import BaseProvider
class TestBaseProvider:
def test_random_element(self, faker, num_samples):
# dicts not allowed because they introduce dependency on PYTHONHASHSEED
with pytest.raises(ValueError):
... | choices | assert | variable | tests/providers/__init__.py | test_random_element | TestBaseProvider | 226 | null |
joke2k/faker | import re
import string
from collections import OrderedDict
import pytest
from faker.providers import BaseProvider
class TestBaseProvider:
def test_random_sample(self, faker):
# Too many items requested
with pytest.raises(ValueError):
faker.random_sample("abcde", 6)
# Same ... | 1 | assert | numeric_literal | tests/providers/__init__.py | test_random_sample | TestBaseProvider | 255 | null |
joke2k/faker | from faker.providers.job import Provider as JobProvider
from faker.providers.job.az_AZ import Provider as AzAzJobProvider
from faker.providers.job.cs_CZ import Provider as CsCzJobProvider
from faker.providers.job.de_AT import Provider as DeAtJobProvider
from faker.providers.job.de_DE import Provider as DeDeJobProvider
... | TrTrJobProvider.jobs | assert | complex_expr | tests/providers/test_job.py | test_job | TestTrTr | 177 | null |
joke2k/faker | import re
from typing import Pattern
from unittest import mock
import pytest
from faker import Faker, providers
from faker.providers.address.az_AZ import Provider as AzAzAddressProvider
from faker.providers.address.cs_CZ import Provider as CsCzAddressProvider
from faker.providers.address.da_DK import Provider as DaD... | 5 | assert | numeric_literal | tests/providers/test_address.py | test_postcode | TestEsEs | 815 | null |
joke2k/faker | import re
import string
from typing import Pattern
from faker.providers.automotive import calculate_vin_str_weight
from faker.providers.automotive.de_AT import Provider as DeAtAutomotiveProvider
from faker.providers.automotive.de_DE import Provider as DeDeAutomotiveProvider
from faker.providers.automotive.es_ES impor... | 2 | assert | numeric_literal | tests/providers/test_automotive.py | test_prefix | TestUkUa | 387 | null |
joke2k/faker | import datetime
import re
import unittest
from unittest import mock
from faker import Faker
from faker.providers.person.ar_AA import Provider as ArProvider
from faker.providers.person.ar_DZ import Provider as ArDZProvider
from faker.providers.person.az_AZ import Provider as AzAzProvider
from faker.providers.person.cs... | str) | self.assertIsInstance | variable | tests/providers/test_person.py | test_first_name | TestAr | 71 | null |
joke2k/faker | import re
from ipaddress import ip_address, ip_network
from itertools import cycle
from typing import Pattern
from unittest.mock import PropertyMock, patch
import pytest
from validators import domain as validate_domain
from validators import email as validate_email
from faker.providers.internet import Provider as I... | 2 | assert | numeric_literal | tests/providers/test_internet.py | test_domain_name | TestZhCn | 505 | null |
joke2k/faker | import datetime
import re
import unittest
from unittest import mock
from faker import Faker
from faker.providers.person.ar_AA import Provider as ArProvider
from faker.providers.person.ar_DZ import Provider as ArDZProvider
from faker.providers.person.az_AZ import Provider as AzAzProvider
from faker.providers.person.cs... | 3 | assert | numeric_literal | tests/providers/test_person.py | test_person | TestJaJP | 1,316 | null |
joke2k/faker | import re
from unittest.mock import patch
import pytest
class TestCurrencyProvider:
num_samples = 100
def setup_class(cls):
from faker.providers.currency import Provider as CurrencyProvider
cls.provider = CurrencyProvider
cls.currencies = cls.provider.currencies
cls.cryptoc... | self.currencies | assert | complex_expr | tests/providers/test_currency.py | test_currency | TestCurrencyProvider | 27 | null |
joke2k/faker | import re
import pytest
from faker.providers.lorem.az_AZ import Provider as AzAzLoremProvider
from faker.providers.lorem.bn_BD import Provider as BnBdLoremProvider
from faker.providers.lorem.cs_CZ import Provider as CsCzLoremProvider
from faker.providers.lorem.de_AT import Provider as DeAtLoremProvider
from faker.pro... | len(sentences) | assert | func_call | tests/providers/test_lorem.py | test_paragraph_with_inexact_sentence_count | TestLoremProvider | 126 | null |
joke2k/faker | import re
import pytest
from faker.providers.lorem.az_AZ import Provider as AzAzLoremProvider
from faker.providers.lorem.bn_BD import Provider as BnBdLoremProvider
from faker.providers.lorem.cs_CZ import Provider as CsCzLoremProvider
from faker.providers.lorem.de_AT import Provider as DeAtLoremProvider
from faker.pro... | num_words | assert | variable | tests/providers/test_lorem.py | test_sentence_with_exact_word_count | TestLoremProvider | 96 | null |
joke2k/faker | import pytest
from faker import Faker
from faker.exceptions import UniquenessException
class TestUniquenessClass:
def test_uniqueness(self):
fake = Faker("en_US")
names = set()
# There are (at time of writing 690) first names in the
# US identity provider. Birthday paradox puts th... | names | assert | variable | tests/test_unique.py | test_uniqueness | TestUniquenessClass | 17 | null |
joke2k/faker | import csv
import datetime
import io
import itertools
import json
import re
import tarfile
import unittest
import uuid
import xml
import zipfile
from typing import Pattern
from unittest.mock import patch
import pytest
from faker import Faker, exceptions
from faker.contrib.pytest.plugin import DEFAULT_LOCALE, DEFAULT... | True | assert | bool_literal | tests/providers/test_misc.py | test_json_passthrough_values | TestMiscProvider | 553 | null |
joke2k/faker | from random import Random
import pytest
from faker.contrib.pytest.plugin import DEFAULT_SEED
_CHANGED_LOCALE = ["it_IT"]
def faker_locale():
return _CHANGED_LOCALE
def faker_seed():
return 4761
def test_no_injection(_session_faker, faker):
random = Random(DEFAULT_SEED)
assert faker != _session_fak... | random.getstate() | assert | func_call | tests/pytest/session_overrides/session_locale/test_autouse_faker_locale.py | test_no_injection | 35 | null | |
joke2k/faker | import io
import string
import sys
import unittest
from unittest.mock import MagicMock, patch
import pytest
from faker import Faker, Generator
from faker.factory import Factory
from faker.generator import random
from faker.utils import decorators, text
class FactoryTestCase(unittest.TestCase):
def setUp(self):
... | "abcé" | assert | string_literal | tests/test_factory.py | test_slugify | FactoryTestCase | 223 | null |
joke2k/faker | import os
import platform
import random
import re
import sys
import time
import unittest
import zoneinfo
from datetime import date, datetime
from datetime import time as datetime_time
from datetime import timedelta, tzinfo
import freezegun
import pytest
from faker import Faker
from faker.providers.date_time import P... | now | assert | variable | tests/providers/test_date_time.py | test_future_datetime | TestDateTime | 125 | null |
joke2k/faker | import io
import string
import sys
import unittest
from unittest.mock import MagicMock, patch
import pytest
from faker import Faker, Generator
from faker.factory import Factory
from faker.generator import random
from faker.utils import decorators, text
class FactoryTestCase(unittest.TestCase):
def setUp(self):
... | min_value | assert | variable | tests/test_factory.py | test_pyfloat_in_range | FactoryTestCase | 316 | null |
joke2k/faker | import io
import string
import sys
import unittest
from unittest.mock import MagicMock, patch
import pytest
from faker import Faker, Generator
from faker.factory import Factory
from faker.generator import random
from faker.utils import decorators, text
class FactoryTestCase(unittest.TestCase):
def setUp(self):
... | "aeiou" | assert | string_literal | tests/test_factory.py | test_slugify | FactoryTestCase | 190 | null |
joke2k/faker | import pytest
from faker.decode import unidecode
@pytest.mark.parametrize(
("text", "result"),
[
(
"Programmes de publicité - Solutions d'entreprise",
"Programmes de publicite - Solutions d'entreprise",
),
("Транслитерирует и русский", "Transliteriruet i russkii... | result | assert | variable | tests/test_decode.py | test_transliterate | 20 | null | |
joke2k/faker | from unittest.mock import patch
import pytest
from faker import Faker, Generator
def generator():
generator = Generator()
generator.add_provider(FooProvider())
return generator
class TestGenerator:
def test_arguments_group_with_values(self, generator):
generator.set_arguments("group1", "arg... | None | assert | none_literal | tests/test_generator.py | test_arguments_group_with_values | TestGenerator | 70 | null |
joke2k/faker | import re
import pytest
from faker.providers.bank import Provider as BankProvider
from faker.providers.bank.az_AZ import Provider as AzAzBankProvider
from faker.providers.bank.cs_CZ import Provider as CsCZBankProvider
from faker.providers.bank.de_CH import Provider as DeChBankProvider
from faker.providers.bank.el_GR ... | AzAzBankProvider.country_code | assert | complex_expr | tests/providers/test_bank.py | test_iban | TestAzAz | 54 | null |
joke2k/faker | import csv
import datetime
import io
import itertools
import json
import re
import tarfile
import unittest
import uuid
import xml
import zipfile
from typing import Pattern
from unittest.mock import patch
import pytest
from faker import Faker, exceptions
from faker.contrib.pytest.plugin import DEFAULT_LOCALE, DEFAULT... | 4 | assert | numeric_literal | tests/providers/test_misc.py | test_uuid4_uuid_object | TestMiscProvider | 83 | null |
joke2k/faker | import json
import unittest
from importlib import import_module
from pathlib import Path
import faker
from faker.config import META_PROVIDERS_MODULES, PROVIDERS
from faker.generator import random
from faker.typing import OrderedDictType
from faker.utils.checksums import calculate_luhn, luhn_checksum
from faker.utils... | a_pop | assert | variable | tests/utils/test_utils.py | test_choice_distribution | UtilsTestCase | 43 | null |
joke2k/faker | import re
import pytest
from faker.providers.lorem.az_AZ import Provider as AzAzLoremProvider
from faker.providers.lorem.bn_BD import Provider as BnBdLoremProvider
from faker.providers.lorem.cs_CZ import Provider as CsCzLoremProvider
from faker.providers.lorem.de_AT import Provider as DeAtLoremProvider
from faker.pro... | num_texts | assert | variable | tests/providers/test_lorem.py | test_texts | TestLoremProvider | 185 | null |
joke2k/faker | from unittest import mock
from faker.sphinx.validator import SampleCodeValidator
class TestSampleCodeValidator:
@mock.patch("faker.sphinx.validator.ast.parse")
def test_ast_parser_called_in_eval_mode(self, mock_ast_parse):
command = "variable.method()"
mock_ast_parse.assert_not_called()
... | command) | assert_* | variable | tests/sphinx/test_validator.py | test_ast_parser_called_in_eval_mode | TestSampleCodeValidator | 12 | null |
joke2k/faker | import re
import pytest
from faker.providers.bank import Provider as BankProvider
from faker.providers.bank.az_AZ import Provider as AzAzBankProvider
from faker.providers.bank.cs_CZ import Provider as CsCZBankProvider
from faker.providers.bank.de_CH import Provider as DeChBankProvider
from faker.providers.bank.el_GR ... | CsCZBankProvider.country_code | assert | complex_expr | tests/providers/test_bank.py | test_iban | TestCsCz | 74 | null |
joke2k/faker | import datetime
import re
import unittest
from unittest import mock
from faker import Faker
from faker.providers.person.ar_AA import Provider as ArProvider
from faker.providers.person.ar_DZ import Provider as ArDZProvider
from faker.providers.person.az_AZ import Provider as AzAzProvider
from faker.providers.person.cs... | 8 | assert | numeric_literal | tests/providers/test_person.py | test_identity_card_number_checksum | TestPlPL | 1,501 | null |
joke2k/faker | import re
from datetime import datetime
from typing import Pattern
from unittest.mock import patch
import pytest
from faker.providers.company.az_AZ import Provider as AzAzCompanyProvider
from faker.providers.company.de_AT import Provider as DeAtCompanyProvider
from faker.providers.company.de_CH import Provider as De... | 7 | assert | numeric_literal | tests/providers/test_company.py | test_regon_checksum | TestPlPl | 261 | null |
joke2k/faker | import json
import unittest
from importlib import import_module
from pathlib import Path
import faker
from faker.config import META_PROVIDERS_MODULES, PROVIDERS
from faker.generator import random
from faker.typing import OrderedDictType
from faker.utils.checksums import calculate_luhn, luhn_checksum
from faker.utils... | b_pop | assert | variable | tests/utils/test_utils.py | test_choice_distribution | UtilsTestCase | 44 | null |
joke2k/faker | import re
import pytest
from faker import Factory
from faker.config import AVAILABLE_LOCALES, DEFAULT_LOCALE, PROVIDERS
locales = AVAILABLE_LOCALES
find_group = re.compile(r"\{\{(\w+)\}\}")
@pytest.mark.parametrize("locale", locales)
def test_no_invalid_formats(locale):
"""
For each locale, for each provid... | None | assert | none_literal | tests/test_providers_formats.py | test_no_invalid_formats | 32 | null | |
joke2k/faker | import copy
import random
import re
from typing import Pattern
import pytest
from faker.providers.color import RandomColor
from faker.providers.color.az_AZ import Provider as AzAzColorProvider
from faker.providers.color.bg_BG import Provider as BgBgColorProvider
from faker.providers.color.cs_CZ import Provider as Cs... | r | assert | variable | tests/providers/test_color.py | test_rgb_color | TestColorProvider | 42 | null |
joke2k/faker | import pytest
from faker import Faker
from faker.exceptions import UniquenessException
class TestSelectiveUniqueness:
def setup_method(self):
self.fake = Faker()
self.fake.unique.clear()
def test_exclude_types_chainable(self):
"""Test that exclude_types returns a new proxy that can be... | proxy2 | assert | variable | tests/test_unique_exclude.py | test_exclude_types_chainable | TestSelectiveUniqueness | 59 | null |
joke2k/faker | import re
from unittest.mock import patch
import pytest
class TestDeAt:
num_samples = 100
def setup_class(cls):
from faker.providers.currency.de_AT import Provider as DeAtCurrencyProvider
cls.provider = DeAtCurrencyProvider
cls.currencies = cls.provider.currencies
cls.curre... | self.currency_names | assert | complex_expr | tests/providers/test_currency.py | test_currency_name | TestDeAt | 185 | null |
joke2k/faker | import re
from ipaddress import ip_address, ip_network
from itertools import cycle
from typing import Pattern
from unittest.mock import PropertyMock, patch
import pytest
from validators import domain as validate_domain
from validators import email as validate_email
from faker.providers.internet import Provider as I... | 3 | assert | numeric_literal | tests/providers/test_internet.py | test_hostname | TestInternetProvider | 92 | null |
joke2k/faker | from random import Random
import pytest
from faker.contrib.pytest.plugin import DEFAULT_LOCALE
_CHANGED_SEED = 4761
def faker_locale():
return ["it_IT"]
def faker_seed():
return _CHANGED_SEED
def test_no_injection(_session_faker, faker):
random = Random(_CHANGED_SEED)
assert faker == _session_fake... | [DEFAULT_LOCALE] | assert | collection | tests/pytest/test_autouse_faker_seed.py | test_no_injection | 33 | null | |
joke2k/faker | import re
import string
from typing import Pattern
from faker.providers.automotive import calculate_vin_str_weight
from faker.providers.automotive.de_AT import Provider as DeAtAutomotiveProvider
from faker.providers.automotive.de_DE import Provider as DeDeAutomotiveProvider
from faker.providers.automotive.es_ES impor... | string.digits | assert | complex_expr | tests/providers/test_automotive.py | test_vin | _SimpleAutomotiveTestMixin | 43 | null |
joke2k/faker | import unittest
from unittest.mock import patch
from faker.cli import Command
class TestCLIArgParsing(unittest.TestCase):
def test_cli_include_argument_parsing(self):
"""Test that the include flag correctly differentiates between a provider and the fake command."""
cmd = Command(["faker", "-i", "... | includes) | self.assertIn | variable | tests/test_cli_arg_parsing.py | test_cli_include_argument_parsing | TestCLIArgParsing | 21 | null |
joke2k/faker | import re
import pytest
from faker.providers.bank import Provider as BankProvider
from faker.providers.bank.az_AZ import Provider as AzAzBankProvider
from faker.providers.bank.cs_CZ import Provider as CsCZBankProvider
from faker.providers.bank.de_CH import Provider as DeChBankProvider
from faker.providers.bank.el_GR ... | validity | assert | variable | tests/providers/test_bank.py | test_clabe_validation | TestEsMx | 276 | null |
joke2k/faker | import re
from unittest.mock import patch
import pytest
class TestCurrencyProvider:
num_samples = 100
def setup_class(cls):
from faker.providers.currency import Provider as CurrencyProvider
cls.provider = CurrencyProvider
cls.currencies = cls.provider.currencies
cls.cryptoc... | "$" | assert | string_literal | tests/providers/test_currency.py | test_currency_symbol_with_valid_code | TestCurrencyProvider | 54 | null |
joke2k/faker | import copy
import random
import re
from typing import Pattern
import pytest
from faker.providers.color import RandomColor
from faker.providers.color.az_AZ import Provider as AzAzColorProvider
from faker.providers.color.bg_BG import Provider as BgBgColorProvider
from faker.providers.color.cs_CZ import Provider as Cs... | hue | assert | variable | tests/providers/test_color.py | test_hue_integer | TestRandomColor | 197 | null |
joke2k/faker | import pytest
from faker.providers.sbn import SBN9
from faker.providers.sbn.en_US import Provider as SBNProvider
from faker.providers.sbn.rules import RegistrantRule
class TestISBN9:
def test_format_length(self):
sbn = SBN9(registrant="4516", publication="7331")
assert len(sbn.format()) == | 9 | assert | numeric_literal | tests/providers/test_sbn.py | test_format_length | TestISBN9 | 19 | null |
joke2k/faker | import copy
import random
import re
from typing import Pattern
import pytest
from faker.providers.color import RandomColor
from faker.providers.color.az_AZ import Provider as AzAzColorProvider
from faker.providers.color.bg_BG import Provider as BgBgColorProvider
from faker.providers.color.cs_CZ import Provider as Cs... | g | assert | variable | tests/providers/test_color.py | test_rgb_color | TestColorProvider | 43 | null |
joke2k/faker | import re
import pytest
from faker.providers.bank import Provider as BankProvider
from faker.providers.bank.az_AZ import Provider as AzAzBankProvider
from faker.providers.bank.cs_CZ import Provider as CsCZBankProvider
from faker.providers.bank.de_CH import Provider as DeChBankProvider
from faker.providers.bank.el_GR ... | EsMxBankProvider.banks | assert | complex_expr | tests/providers/test_bank.py | test_bank | TestEsMx | 256 | null |
joke2k/faker | import re
from typing import Pattern
from unittest import mock
import pytest
from faker import Faker, providers
from faker.providers.address.az_AZ import Provider as AzAzAddressProvider
from faker.providers.address.cs_CZ import Provider as CsCzAddressProvider
from faker.providers.address.da_DK import Provider as DaD... | 2 | assert | numeric_literal | tests/providers/test_address.py | test_alpha_2_country_codes | TestBaseProvider | 68 | null |
joke2k/faker | import re
import unittest
from decimal import Decimal
from faker import Faker
from faker.providers.geo.pt_PT import Provider as PtPtProvider
class TestEnUS(unittest.TestCase):
def setUp(self):
self.fake = Faker("en_US")
Faker.seed(0)
def test_coordinate_rounded(self):
loc = self.fak... | round(loc) | assert | func_call | tests/providers/test_geo.py | test_coordinate_rounded | TestEnUS | 62 | null |
joke2k/faker | import json
import unittest
from importlib import import_module
from pathlib import Path
import faker
from faker.config import META_PROVIDERS_MODULES, PROVIDERS
from faker.generator import random
from faker.typing import OrderedDictType
from faker.utils.checksums import calculate_luhn, luhn_checksum
from faker.utils... | d_pop | assert | variable | tests/utils/test_utils.py | test_choice_distribution | UtilsTestCase | 46 | null |
joke2k/faker | import re
import string
from typing import Pattern
from faker.providers.automotive import calculate_vin_str_weight
from faker.providers.automotive.de_AT import Provider as DeAtAutomotiveProvider
from faker.providers.automotive.de_DE import Provider as DeDeAutomotiveProvider
from faker.providers.automotive.es_ES impor... | "CA" | assert | string_literal | tests/providers/test_automotive.py | test_plate_old_format_explicit_province_prefix | TestEsEs | 144 | null |
joke2k/faker | import unittest
from unittest.mock import patch
from faker.cli import Command
class TestCLIArgParsing(unittest.TestCase):
def test_cli_multiple_includes(self):
"""Test that multiple include flags are correctly accumulated."""
cmd = Command(["faker", "-i", "p1", "-i", "p2", "profile"])
w... | ["p1", "p2"]) | self.assertEqual | collection | tests/test_cli_arg_parsing.py | test_cli_multiple_includes | TestCLIArgParsing | 32 | null |
joke2k/faker | import re
from typing import Pattern
from unittest import mock
import pytest
from faker import Faker, providers
from faker.providers.address.az_AZ import Provider as AzAzAddressProvider
from faker.providers.address.cs_CZ import Provider as CsCzAddressProvider
from faker.providers.address.da_DK import Provider as DaD... | int(code) | assert | func_call | tests/providers/test_address.py | test_postcode | TestEnUS | 615 | null |
joke2k/faker | from unittest.mock import patch
import pytest
from faker import Faker, Generator
def generator():
generator = Generator()
generator.add_provider(FooProvider())
return generator
class TestGenerator:
def test_arguments_group_with_values(self, generator):
generator.set_arguments("group1", "arg... | 1 | assert | numeric_literal | tests/test_generator.py | test_arguments_group_with_values | TestGenerator | 68 | null |
joke2k/faker | import json
import unittest
from importlib import import_module
from pathlib import Path
import faker
from faker.config import META_PROVIDERS_MODULES, PROVIDERS
from faker.generator import random
from faker.typing import OrderedDictType
from faker.utils.checksums import calculate_luhn, luhn_checksum
from faker.utils... | a | assert | variable | tests/utils/test_utils.py | test_choice_distribution | UtilsTestCase | 26 | null |
joke2k/faker | import re
from datetime import datetime
from typing import Pattern
from unittest.mock import patch
import pytest
from faker.providers.company.az_AZ import Provider as AzAzCompanyProvider
from faker.providers.company.de_AT import Provider as DeAtCompanyProvider
from faker.providers.company.de_CH import Provider as De... | 9 | assert | numeric_literal | tests/providers/test_company.py | test_regon_checksum | TestPlPl | 260 | null |
joke2k/faker | import unittest
from faker import Faker
class TestProfileProvider(unittest.TestCase):
num_samples = 10
def setUp(self):
self.fake = Faker()
Faker.seed(0)
def test_profile(self):
for _ in range(self.num_samples):
profile = self.fake.profile()
assert isinst... | 2 | assert | numeric_literal | tests/providers/test_profile.py | test_profile | TestProfileProvider | 41 | null |
joke2k/faker | import decimal
import sys
import unittest
import warnings
from collections import Counter
from typing import Iterable, Optional, Type, Union
from unittest.mock import patch
import pytest
from faker import Faker
class TestPystr(unittest.TestCase):
def setUp(self):
self.fake = Faker(includes=["tests.mymod... | 5 | assert | numeric_literal | tests/providers/test_python.py | test_upper_length_limit | TestPystr | 570 | null |
joke2k/faker | import re
import pytest
from faker.providers.bank import Provider as BankProvider
from faker.providers.bank.az_AZ import Provider as AzAzBankProvider
from faker.providers.bank.cs_CZ import Provider as CsCZBankProvider
from faker.providers.bank.de_CH import Provider as DeChBankProvider
from faker.providers.bank.el_GR ... | AzAzBankProvider.banks | assert | complex_expr | tests/providers/test_bank.py | test_bank | TestAzAz | 60 | null |
joke2k/faker | import os
import platform
import random
import re
import sys
import time
import unittest
import zoneinfo
from datetime import date, datetime
from datetime import time as datetime_time
from datetime import timedelta, tzinfo
import freezegun
import pytest
from faker import Faker
from faker.providers.date_time import P... | 4 | assert | numeric_literal | tests/providers/test_date_time.py | test_year | TestZhTw | 1,279 | null |
joke2k/faker | import re
import string
from collections import OrderedDict
import pytest
from faker.providers import BaseProvider
class TestBaseProvider:
def test_random_sample(self, faker):
# Too many items requested
with pytest.raises(ValueError):
faker.random_sample("abcde", 6)
# Same ... | [] | assert | collection | tests/providers/__init__.py | test_random_sample | TestBaseProvider | 260 | null |
joke2k/faker | from random import Random
import pytest
from faker.contrib.pytest.plugin import DEFAULT_SEED
from tests.pytest.session_overrides.session_locale import _MODULE_LOCALES
def faker_locale():
return ["it_IT"]
def faker_seed():
return 4761
def test_no_injection(_session_faker, faker):
random = Random(DEFAULT... | random | assert | variable | tests/pytest/session_overrides/session_locale/test_manual_injection.py | test_no_injection | 31 | null | |
joke2k/faker | import csv
import datetime
import io
import itertools
import json
import re
import tarfile
import unittest
import uuid
import xml
import zipfile
from typing import Pattern
from unittest.mock import patch
import pytest
from faker import Faker, exceptions
from faker.contrib.pytest.plugin import DEFAULT_LOCALE, DEFAULT... | 1 | assert | numeric_literal | tests/providers/test_misc.py | test_json_passthrough_values | TestMiscProvider | 551 | null |
joke2k/faker | import re
from typing import Pattern
import pytest
class TestBarcodeProvider:
num_samples = 1000
ean8_pattern: Pattern = re.compile(r"\d{8}")
ean13_pattern: Pattern = re.compile(r"\d{13}")
def test_ean13_no_leading_zero(self, faker, num_samples):
for _ in range(num_samples):
ean... | "0" | assert | string_literal | tests/providers/test_barcode.py | test_ean13_no_leading_zero | TestBarcodeProvider | 55 | null |
sissaschool/xmlschema | import unittest
import os
import base64
import json
import math
import pathlib
from decimal import Decimal
from collections.abc import MutableMapping, MutableSequence, Set
from textwrap import dedent
from xml.etree import ElementTree
from elementpath import datatypes
import xmlschema
from xmlschema import XMLSchemaVal... | 2) | self.assertEqual | numeric_literal | tests/validation/test_decoding.py | test_keep_empty | TestDecoding | 1,236 | null |
sissaschool/xmlschema | import pathlib
import warnings
from xml.etree import ElementTree
from xmlschema import XMLSchemaValidationError, XMLSchema10, XMLSchema11
from xmlschema.extras.wsdl import WsdlParseError, WsdlComponent, WsdlMessage, \
WsdlPortType, WsdlOperation, WsdlBinding, WsdlService, Wsdl11Document, \
WsdlInput, SoapHeade... | 0) | self.assertEqual | numeric_literal | tests/test_wsdl.py | test_validation_mode | TestWsdlDocuments | 222 | null |
sissaschool/xmlschema | import sys
import unittest
import decimal
import logging
import warnings
from collections import OrderedDict
from xml.etree import ElementTree
from xmlschema import XMLSchema, XMLSchemaParseError
from xmlschema.names import XSD_NAMESPACE, XSI_NAMESPACE, XSD_SCHEMA, \
XSD_ELEMENT, XSD_SIMPLE_TYPE, XSD_ANNOTATION, X... | 3) | self.assertEqual | numeric_literal | tests/test_utils.py | test_logged_decorator | TestUtils | 803 | null |
sissaschool/xmlschema | import unittest
from textwrap import dedent
from typing import Any, Union, List, Optional
from xmlschema import XMLSchema, XMLSchemaModelError, XMLSchemaModelDepthError
from xmlschema.exceptions import XMLSchemaValueError
from xmlschema.validators import ParticleMixin, XsdGroup, XsdElement
class TestXsdGroups(unittes... | 2) | self.assertEqual | numeric_literal | tests/validators/test_groups.py | test_effective_max_occurs | TestXsdGroups | 143 | null |
sissaschool/xmlschema | import unittest
import os
import io
import pathlib
from xml.etree import ElementTree
from xmlschema import XMLSchema, XMLResource, iter_errors
from xmlschema.utils.etree import is_etree_element
from xmlschema.validators.exceptions import XMLSchemaValidatorError, \
XMLSchemaNotBuiltError, XMLSchemaParseError, XMLSc... | 0) | self.assertEqual | numeric_literal | tests/validators/test_exceptions.py | test_validation_error_logging | TestValidatorExceptions | 405 | null |
sissaschool/xmlschema | import unittest
from decimal import Decimal
from textwrap import dedent
from elementpath import datatypes
from elementpath.datatypes import AbstractDateTime
from xmlschema import XMLSchemaDecodeError, XMLSchemaEncodeError, \
XMLSchemaValidationError, XMLSchema10, XMLSchema11
from xmlschema.utils.etree import is_et... | list) | self.assertIsInstance | variable | tests/validators/test_builtins.py | test_facet_lists | TestXsd10BuiltinTypes | 39 | null |
sissaschool/xmlschema | import pathlib
import warnings
from xmlschema import XMLSchema11
from xmlschema import SchemaLoader, LocationSchemaLoader, SafeSchemaLoader
from xmlschema.testing import XMLSchemaTestCase, run_xmlschema_tests
from xmlschema import XMLSchemaParseError
import xmlschema.names as nm
class TestSchemaLoader(XMLSchemaTestCa... | 1) | self.assertEqual | numeric_literal | tests/test_loaders.py | test_load_single | TestSchemaLoader | 69 | null |
sissaschool/xmlschema | import sys
import unittest
import decimal
import logging
import warnings
from collections import OrderedDict
from xml.etree import ElementTree
from xmlschema import XMLSchema, XMLSchemaParseError
from xmlschema.names import XSD_NAMESPACE, XSI_NAMESPACE, XSD_SCHEMA, \
XSD_ELEMENT, XSD_SIMPLE_TYPE, XSD_ANNOTATION, X... | 0) | self.assertEqual | numeric_literal | tests/test_utils.py | test_logged_decorator | TestUtils | 794 | null |
sissaschool/xmlschema | import pathlib
from textwrap import dedent
from xmlschema import XMLSchema11
from xmlschema.testing import XsdValidatorTestCase
class TestXsdAssert(XsdValidatorTestCase):
cases_dir = pathlib.Path(__file__).parent.joinpath('../test_cases')
schema_class = XMLSchema11
def test_base_api(self):
schema... | 0) | self.assertEqual | numeric_literal | tests/validators/test_assertions.py | test_base_api | TestXsdAssert | 43 | null |
sissaschool/xmlschema | import pathlib
from textwrap import dedent
from xmlschema import XMLSchemaParseError, XMLSchemaValidationError
from xmlschema.validators import XMLSchema11, XsdAttribute, XsdAttributeGroup
from xmlschema.testing import XsdValidatorTestCase
from xmlschema.names import XSI_NAMESPACE, XSD_ANY_SIMPLE_TYPE, XSD_STRING
cla... | 'beta') | self.assertEqual | string_literal | tests/validators/test_attributes.py | test_value_constraint_property | TestXsdAttributes | 450 | null |
sissaschool/xmlschema | import pathlib
from textwrap import dedent
from xmlschema import XMLSchema11
from xmlschema.testing import XsdValidatorTestCase
class TestXsdAssert(XsdValidatorTestCase):
cases_dir = pathlib.Path(__file__).parent.joinpath('../test_cases')
schema_class = XMLSchema11
def test_base_api(self):
schema... | 1) | self.assertEqual | numeric_literal | tests/validators/test_assertions.py | test_base_api | TestXsdAssert | 34 | null |
sissaschool/xmlschema | import unittest
import os
import datetime
import ast
import logging
import platform
import importlib.util
import tempfile
from collections import namedtuple
from pathlib import Path
from textwrap import dedent
from xml.etree import ElementTree
from elementpath import datatypes
from xmlschema import XMLSchema10, XMLSc... | 'a') | self.assertEqual | string_literal | tests/test_codegen.py | test_type_name_filter | TestAbstractGenerator | 438 | null |
sissaschool/xmlschema | import decimal
import pathlib
import unittest
from textwrap import dedent
from xml.etree import ElementTree
from elementpath import datatypes
from elementpath.etree import etree_tostring
from xmlschema import XMLSchemaEncodeError, XMLSchemaValidationError
from xmlschema.converters import UnorderedConverter, JsonMLCon... | 'b1') | self.assertEqual | string_literal | tests/validation/test_encoding.py | test_element_encoding_with_defaults__issue_218 | TestEncoding | 598 | null |
sissaschool/xmlschema | import pdb
import os
import ast
import pickle
import re
import time
import logging
import tempfile
import warnings
from importlib import util as importlib_util
from xml.etree import ElementTree
import xmlschema
from xmlschema import XMLSchemaBase, XMLSchema11, XMLSchemaValidationError, \
XMLSchemaParseError, Unord... | self.chunks[0]) | self.assertEqual | complex_expr | xmlschema/testing/_builders.py | check_decode_api | TestValidator | 473 | null |
sissaschool/xmlschema | import unittest
import os
import base64
import json
import math
import pathlib
from decimal import Decimal
from collections.abc import MutableMapping, MutableSequence, Set
from textwrap import dedent
from xml.etree import ElementTree
from elementpath import datatypes
import xmlschema
from xmlschema import XMLSchemaVal... | 0) | self.assertEqual | numeric_literal | tests/validation/test_decoding.py | test_skip_wildcard_decoding | TestDecoding | 1,020 | null |
sissaschool/xmlschema | import unittest
import os
import io
import pathlib
from xml.etree import ElementTree
from xmlschema import XMLSchema, XMLResource, iter_errors
from xmlschema.utils.etree import is_etree_element
from xmlschema.validators.exceptions import XMLSchemaValidatorError, \
XMLSchemaNotBuiltError, XMLSchemaParseError, XMLSc... | 2) | self.assertEqual | numeric_literal | tests/validators/test_exceptions.py | test_sourceline__issue_456 | TestValidatorExceptions | 424 | null |
sissaschool/xmlschema | import unittest
import os
import pathlib
import decimal
from textwrap import dedent
from xml.etree import ElementTree
import xmlschema
from xmlschema import XMLSchema10, XMLSchemaValidationError, XMLSchemaStopValidation, \
XMLSchemaChildrenValidationError
from xmlschema.validators import XMLSchema11, ValidationCo... | result) | self.assertEqual | variable | tests/validation/test_validation.py | test_fragment_validation__issue_457 | TestValidation | 686 | null |
sissaschool/xmlschema | import decimal
import pathlib
import unittest
from textwrap import dedent
from xml.etree import ElementTree
from elementpath import datatypes
from elementpath.etree import etree_tostring
from xmlschema import XMLSchemaEncodeError, XMLSchemaValidationError
from xmlschema.converters import UnorderedConverter, JsonMLCon... | []) | self.assertListEqual | collection | tests/validation/test_encoding.py | test_wildcard_with_foreign_and_jsonml__issue_298 | TestEncoding | 751 | null |
sissaschool/xmlschema | import unittest
import os
import pathlib
import decimal
from textwrap import dedent
from xml.etree import ElementTree
import xmlschema
from xmlschema import XMLSchema10, XMLSchemaValidationError, XMLSchemaStopValidation, \
XMLSchemaChildrenValidationError
from xmlschema.validators import XMLSchema11, ValidationCo... | obj) | self.assertIs | variable | tests/validation/test_validation.py | test_get_converter | TestValidationContext | 77 | null |
sissaschool/xmlschema | import unittest
import os
import io
import pathlib
from xml.etree import ElementTree
from xmlschema import XMLSchema, XMLResource, iter_errors
from xmlschema.utils.etree import is_etree_element
from xmlschema.validators.exceptions import XMLSchemaValidatorError, \
XMLSchemaNotBuiltError, XMLSchemaParseError, XMLSc... | 9) | self.assertEqual | numeric_literal | tests/validators/test_exceptions.py | test_sourceline__issue_456 | TestValidatorExceptions | 426 | null |
sissaschool/xmlschema | import pathlib
import warnings
from xml.etree import ElementTree
from xmlschema import XMLSchemaValidationError, XMLSchema10, XMLSchema11
from xmlschema.extras.wsdl import WsdlParseError, WsdlComponent, WsdlMessage, \
WsdlPortType, WsdlOperation, WsdlBinding, WsdlService, Wsdl11Document, \
WsdlInput, SoapHeade... | []) | self.assertEqual | collection | tests/test_wsdl.py | test_wsdl_port_type | TestWsdlDocuments | 633 | null |
sissaschool/xmlschema | import unittest
import copy
import pathlib
from itertools import zip_longest
from textwrap import dedent
from typing import Any, Union, List, Optional
from xmlschema import XMLSchema11
from xmlschema.exceptions import XMLSchemaValueError
from xmlschema.validators.exceptions import XMLSchemaValidationError, XMLSchemaM... | c) | self.assertIs | variable | tests/validators/test_models.py | test_get_model_particle | TestModelValidation | 1,170 | null |
sissaschool/xmlschema | import unittest
import os
import pathlib
import decimal
from textwrap import dedent
from xml.etree import ElementTree
import xmlschema
from xmlschema import XMLSchema10, XMLSchemaValidationError, XMLSchemaStopValidation, \
XMLSchemaChildrenValidationError
from xmlschema.validators import XMLSchema11, ValidationCo... | bytes) | self.assertIsInstance | variable | tests/validation/test_validation.py | test_issue_238__validate_bytes_strings | TestValidation | 467 | null |
sissaschool/xmlschema | import unittest
import warnings
from pathlib import Path
from typing import cast, MutableMapping, Optional, Type
from xml.etree.ElementTree import Element, parse as etree_parse
from elementpath.etree import etree_tostring
from xmlschema import XMLSchema, XMLSchemaValidationError, fetch_namespaces
from xmlschema.datao... | obj2) | self.assertEqual | variable | tests/test_converters.py | test_decode_encode_default_converter | TestConverters | 251 | null |
sissaschool/xmlschema | import unittest
import os
import io
import pathlib
from xml.etree import ElementTree
from xmlschema import XMLSchema, XMLResource, iter_errors
from xmlschema.utils.etree import is_etree_element
from xmlschema.validators.exceptions import XMLSchemaValidatorError, \
XMLSchemaNotBuiltError, XMLSchemaParseError, XMLSc... | 4) | self.assertEqual | numeric_literal | tests/validators/test_exceptions.py | test_sourceline__issue_456 | TestValidatorExceptions | 425 | null |
sissaschool/xmlschema | import unittest
import os
import io
import pathlib
from xml.etree import ElementTree
from xmlschema import XMLSchema, XMLResource, iter_errors
from xmlschema.utils.etree import is_etree_element
from xmlschema.validators.exceptions import XMLSchemaValidatorError, \
XMLSchemaNotBuiltError, XMLSchemaParseError, XMLSc... | int) | self.assertIs | variable | tests/validators/test_exceptions.py | test_decode_error | TestValidatorExceptions | 257 | null |
sissaschool/xmlschema | import unittest
import os
import io
import pathlib
from xml.etree import ElementTree
from xmlschema import XMLSchema, XMLResource, iter_errors
from xmlschema.utils.etree import is_etree_element
from xmlschema.validators.exceptions import XMLSchemaValidatorError, \
XMLSchemaNotBuiltError, XMLSchemaParseError, XMLSc... | '10') | self.assertEqual | string_literal | tests/validators/test_exceptions.py | test_exception_repr_lxml | TestValidatorExceptions | 162 | null |
sissaschool/xmlschema | import decimal
import pathlib
import unittest
from textwrap import dedent
from xml.etree import ElementTree
from elementpath import datatypes
from elementpath.etree import etree_tostring
from xmlschema import XMLSchemaEncodeError, XMLSchemaValidationError
from xmlschema.converters import UnorderedConverter, JsonMLCon... | 'NaN') | self.assertEqual | string_literal | tests/validation/test_encoding.py | test_float_encoding | TestEncoding | 735 | null |
sissaschool/xmlschema | import unittest
import os
import io
import pathlib
import tempfile
from decimal import Decimal
from textwrap import dedent
from xml.etree import ElementTree
from xmlschema import XMLSchema10, XMLSchema11, XmlDocument, XMLResourceError, \
XMLSchemaValidationError, XMLSchemaDecodeError, to_json, from_json, validate,... | ()) | self.assertEqual | collection | tests/test_documents.py | test_xml_document_init_with_schema | TestXmlDocuments | 300 | null |
sissaschool/xmlschema | import pathlib
import warnings
from xml.etree import ElementTree
from xmlschema import XMLSchemaValidationError, XMLSchema10, XMLSchema11
from xmlschema.extras.wsdl import WsdlParseError, WsdlComponent, WsdlMessage, \
WsdlPortType, WsdlOperation, WsdlBinding, WsdlService, Wsdl11Document, \
WsdlInput, SoapHeade... | {}) | self.assertEqual | collection | tests/test_wsdl.py | test_wsdl_message | TestWsdlDocuments | 587 | null |
sissaschool/xmlschema | import unittest
import os
import datetime
import ast
import logging
import platform
import importlib.util
import tempfile
from collections import namedtuple
from pathlib import Path
from textwrap import dedent
from xml.etree import ElementTree
from elementpath import datatypes
from xmlschema import XMLSchema10, XMLSc... | list) | self.assertIsInstance | variable | tests/test_codegen.py | test_searchpaths | TestAbstractGenerator | 177 | null |
sissaschool/xmlschema | import pathlib
from xmlschema import XMLSchemaParseError
from xmlschema.validators import XMLSchema11
from xmlschema.testing import XsdValidatorTestCase
class TestXsdElements(XsdValidatorTestCase):
cases_dir = pathlib.Path(__file__).parent.joinpath('../test_cases')
def test_name_attribute(self):
sch... | 1) | self.assertEqual | numeric_literal | tests/validators/test_elements.py | test_name_attribute | TestXsdElements | 55 | null |
sissaschool/xmlschema | import sys
import unittest
import decimal
import logging
import warnings
from collections import OrderedDict
from xml.etree import ElementTree
from xmlschema import XMLSchema, XMLSchemaParseError
from xmlschema.names import XSD_NAMESPACE, XSI_NAMESPACE, XSD_SCHEMA, \
XSD_ELEMENT, XSD_SIMPLE_TYPE, XSD_ANNOTATION, X... | 1) | self.assertEqual | numeric_literal | tests/test_utils.py | test_logged_decorator | TestUtils | 798 | null |
sissaschool/xmlschema | import unittest
import warnings
from pathlib import Path
from typing import cast, MutableMapping, Optional, Type
from xml.etree.ElementTree import Element, parse as etree_parse
from elementpath.etree import etree_tostring
from xmlschema import XMLSchema, XMLSchemaValidationError, fetch_namespaces
from xmlschema.datao... | '_') | self.assertEqual | string_literal | tests/test_converters.py | test_prefix_arguments | TestConverters | 88 | null |
sissaschool/xmlschema | import unittest
import warnings
from typing import Any
from xmlschema import XMLSchema10, XMLSchema11
from xmlschema.namespaces import NamespaceView
import xmlschema.names as nm
class TestXsd10GlobalsMaps(unittest.TestCase):
schema_class = XMLSchema10
def setUpClass(cls):
cls.schema_class.meta_schem... | k+1) | self.assertEqual | complex_expr | tests/validators/test_xsd_globals.py | test_deprecated_api | TestXsd10GlobalsMaps | 141 | null |
sissaschool/xmlschema | import pathlib
from xmlschema import XMLSchemaParseError
from xmlschema.validators import XMLSchema11, XsdDefaultOpenContent
from xmlschema.testing import XsdValidatorTestCase
class TestXsdWildcards(XsdValidatorTestCase):
cases_dir = pathlib.Path(__file__).parent.joinpath('../test_cases')
def test_namespace... | set()) | self.assertEqual | func_call | tests/validators/test_wildcards.py | test_namespace_variants | TestXsdWildcards | 164 | null |
sissaschool/xmlschema | import unittest
import glob
import fileinput
import os
import re
import importlib
import platform
import pathlib
from itertools import chain
class TestPackaging(unittest.TestCase):
def setUpClass(cls):
cls.test_dir = os.path.dirname(os.path.abspath(__file__))
cls.package_dir = os.path.dirname(cls.... | 0) | self.assertEqual | numeric_literal | tests/test_package.py | test_wrong_copyright_info | TestPackaging | 84 | null |
sissaschool/xmlschema | import unittest
import os
import pathlib
import decimal
from textwrap import dedent
from xml.etree import ElementTree
import xmlschema
from xmlschema import XMLSchema10, XMLSchemaValidationError, XMLSchemaStopValidation, \
XMLSchemaChildrenValidationError
from xmlschema.validators import XMLSchema11, ValidationCo... | 1) | self.assertEqual | numeric_literal | tests/validation/test_validation.py | test_incorrect_validation_errors__issue_372 | TestValidation11 | 780 | null |
sissaschool/xmlschema | import pdb
import os
import ast
import pickle
import re
import time
import logging
import tempfile
import warnings
from importlib import util as importlib_util
from xml.etree import ElementTree
import xmlschema
from xmlschema import XMLSchemaBase, XMLSchema11, XMLSchemaValidationError, \
XMLSchemaParseError, Unord... | self.chunks) | self.assertEqual | complex_expr | xmlschema/testing/_builders.py | check_schema_serialization | TestValidator | 465 | null |
sissaschool/xmlschema | import unittest
import warnings
from pathlib import Path
from typing import cast, MutableMapping, Optional, Type
from xml.etree.ElementTree import Element, parse as etree_parse
from elementpath.etree import etree_tostring
from xmlschema import XMLSchema, XMLSchemaValidationError, fetch_namespaces
from xmlschema.datao... | 2) | self.assertEqual | numeric_literal | tests/test_converters.py | test_mixed_content__issue_315 | TestConverters | 695 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.