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
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...
6)
self.assertEqual
numeric_literal
tests/validators/test_groups.py
test_iter_model
TestXsdGroups
202
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...
0)
self.assertGreater
numeric_literal
tests/test_loaders.py
test_load_single
TestSchemaLoader
73
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,...
str)
self.assertIsInstance
variable
tests/test_documents.py
test_to_json_api
TestXmlDocuments
56
null
sissaschool/xmlschema
import pathlib from xmlschema import XMLSchemaParseError, XMLSchemaValidationError from xmlschema.names import XSD_LIST, XSD_UNION from xmlschema.validators import XMLSchema11 from xmlschema.testing import XsdValidatorTestCase class TestXsdSimpleTypes(XsdValidatorTestCase): cases_dir = pathlib.Path(__file__).par...
'list')
self.assertEqual
string_literal
tests/validators/test_simple_types.py
test_variety_property
TestXsdSimpleTypes
61
null
sissaschool/xmlschema
import io import unittest import os import contextlib import copy import pathlib import platform import warnings from io import StringIO, BytesIO from urllib.request import urlopen, build_opener, FileHandler from urllib.response import addinfourl from urllib.parse import urlsplit, uses_relative from pathlib import Path...
'')
self.assertEqual
string_literal
tests/test_resources.py
test_xml_resource_namespace
TestResources
450
null
sissaschool/xmlschema
import unittest from unittest.mock import patch import glob import io import logging import pathlib import os import platform import sys import xmlschema from xmlschema.cli import get_loglevel, get_converter, validate, xml2json, json2xml from xmlschema.testing import run_xmlschema_tests WORK_DIRECTORY = os.getcwd() ...
stderr)
self.assertIn
variable
tests/test_cli.py
test_validate_command_04
TestConsoleScripts
85
null
sissaschool/xmlschema
import unittest import decimal import pathlib from xml.etree import ElementTree from textwrap import dedent from xmlschema import XMLSchema10, XMLSchema11, XMLSchemaValidationError, \ XMLSchemaParseError from xmlschema.names import XSD_NAMESPACE, XSD_LENGTH, XSD_MIN_LENGTH, XSD_MAX_LENGTH, \ XSD_WHITE_SPACE, X...
facet2)
self.assertIsNot
variable
tests/validators/test_facets.py
test_min_inclusive_facet_restriction
TestXsdFacets
377
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...
len(self.errors))
self.assertEqual
func_call
xmlschema/testing/_builders.py
check_schema_serialization
TestValidator
464
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...
[])
self.assertListEqual
collection
tests/validation/test_validation.py
test_document_iter_errors_api
TestValidation
242
null
sissaschool/xmlschema
import unittest import copy import xml.etree.ElementTree as ElementTree from pathlib import Path from typing import Dict from xmlschema import XMLSchema10, XMLSchema11, fetch_namespaces, etree_tostring, \ XMLSchemaValidationError, DataElement, DataElementConverter, XMLResource, \ XsdElement, XsdAttribute, XsdT...
{})
self.assertEqual
collection
tests/test_dataobjects.py
test_attributes
TestDataElementInterface
40
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,...
1)
self.assertEqual
numeric_literal
tests/test_documents.py
test_to_json_api
TestXmlDocuments
66
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...
3)
self.assertEqual
numeric_literal
tests/validators/test_exceptions.py
test_invalid_child_property
TestValidatorExceptions
380
null
sissaschool/xmlschema
import io import unittest import os import contextlib import copy import pathlib import platform import warnings from io import StringIO, BytesIO from urllib.request import urlopen, build_opener, FileHandler from urllib.response import addinfourl from urllib.parse import urlsplit, uses_relative from pathlib import Path...
2)
self.assertEqual
numeric_literal
tests/test_resources.py
test_xml_resource_get_locations
TestResources
1,128
null
sissaschool/xmlschema
import io import unittest import copy from textwrap import dedent from xmlschema import XMLResource, XMLSchemaConverter from xmlschema.locations import get_locations from xmlschema.names import XSD_NAMESPACE, XSI_NAMESPACE from xmlschema.namespaces import NamespaceMapper from xmlschema.locations import NamespaceResour...
{})
self.assertEqual
collection
tests/test_namespaces.py
test_init
TestNamespaceResourcesMap
464
null
sissaschool/xmlschema
import unittest import os import pathlib import platform import subprocess import sys import tempfile class TestMemoryUsage(unittest.TestCase): def get_memory_usage(output): if '-v' in sys.argv: sys.stdout.write(f'\n {output.strip()} ') return int(output.strip().rsplit('(')[-1][:-1]) ...
20 * 1024 ** 2)
self.assertLess
complex_expr
tests/run_memory_tests.py
test_package_memory_usage
TestMemoryUsage
40
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....
os.path.isfile(filename))
self.assertTrue
func_call
tests/test_package.py
test_base_schema_files
TestPackaging
131
null
sissaschool/xmlschema
import unittest import os import pathlib from xml.etree import ElementTree from elementpath import XPath1Parser, XPath2Parser, Selector, LazyElementNode from xmlschema import XMLSchema10, XMLSchema11 from xmlschema.names import XSD_NAMESPACE from xmlschema.xpath import XMLSchemaProxy, XPathElement, split_path, Elemen...
[])
self.assertListEqual
collection
tests/test_xpath.py
test_iteration
XPathElementTest
151
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...
1)
self.assertEqual
numeric_literal
tests/validators/test_groups.py
test_effective_min_occurs
TestXsdGroups
122
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
82
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...
o2)
self.assertIs
variable
tests/validators/test_models.py
check_copy_equivalence
TestModelValidation
136
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...
4)
self.assertEqual
numeric_literal
tests/test_loaders.py
test_load_composite
TestSchemaLoader
84
null
sissaschool/xmlschema
import unittest import decimal import pathlib from xml.etree import ElementTree from textwrap import dedent from xmlschema import XMLSchema10, XMLSchema11, XMLSchemaValidationError, \ XMLSchemaParseError from xmlschema.names import XSD_NAMESPACE, XSD_LENGTH, XSD_MIN_LENGTH, XSD_MAX_LENGTH, \ XSD_WHITE_SPACE, X...
facet(0))
self.assertIsNone
func_call
tests/validators/test_facets.py
test_min_inclusive_facet
TestXsdFacets
337
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...
'}')
self.assertEqual
string_literal
tests/validation/test_decoding.py
test_json_lazy_decoding
TestDecoding
760
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
85
null
sissaschool/xmlschema
import unittest import filecmp import glob import os import re import pathlib import platform import tempfile import warnings from xmlschema import XMLSchema10, XMLSchema11 from xmlschema.exports import download_schemas from xmlschema.testing import SKIP_REMOTE_TESTS, XMLSchemaTestCase, run_xmlschema_tests class Test...
0)
self.assertGreater
numeric_literal
tests/test_exports.py
test_export_remote__issue_187
TestExports
200
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...
'b')
self.assertEqual
string_literal
tests/test_codegen.py
test_type_name_filter
TestAbstractGenerator
439
null
sissaschool/xmlschema
import unittest import copy import xml.etree.ElementTree as ElementTree from pathlib import Path from typing import Dict from xmlschema import XMLSchema10, XMLSchema11, fetch_namespaces, etree_tostring, \ XMLSchemaValidationError, DataElement, DataElementConverter, XMLResource, \ XsdElement, XsdAttribute, XsdT...
1)
self.assertEqual
numeric_literal
tests/test_dataobjects.py
test_mutable_mapping_api
TestDataObjects
172
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_get_context_without_schema
TestXmlDocuments
241
null
sissaschool/xmlschema
import io import unittest import os import contextlib import copy import pathlib import platform import warnings from io import StringIO, BytesIO from urllib.request import urlopen, build_opener, FileHandler from urllib.response import addinfourl from urllib.parse import urlsplit, uses_relative from pathlib import Path...
0)
self.assertEqual
numeric_literal
tests/test_resources.py
test_xml_resource_seek
TestResources
762
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...
assertion.built)
self.assertTrue
complex_expr
tests/validators/test_assertions.py
test_base_api
TestXsdAssert
39
null
sissaschool/xmlschema
import unittest from xml.etree import ElementTree from xmlschema import XMLSchemaParseError from xmlschema.names import XSD_NOTATION from xmlschema.validators import XMLSchema10, XMLSchema11, XsdNotation class TestXsd10Notations(unittest.TestCase): schema_class = XMLSchema10 def test_parse(self): sc...
[])
self.assertListEqual
collection
tests/validators/test_notations.py
test_parse
TestXsd10Notations
48
null
sissaschool/xmlschema
import pathlib import unittest import re import os from textwrap import dedent from xml.etree.ElementTree import Element, iselement from xmlschema.exceptions import XMLSchemaValueError from xmlschema.names import XSD_NAMESPACE, XSI_NAMESPACE, XSD_SCHEMA from xmlschema.utils.qnames import get_namespace from xmlschema.r...
match)
self.assertIsNone
variable
xmlschema/testing/_test_case_classes.py
check_namespace_prefixes
XsdValidatorTestCase
153
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...
'b2')
self.assertEqual
string_literal
tests/validation/test_encoding.py
test_element_encoding_with_defaults__issue_218
TestEncoding
600
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...
obj[0])
self.assertEqual
complex_expr
tests/validation/test_encoding.py
check_encode
TestEncoding
48
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...
'str')
self.assertEqual
string_literal
tests/test_codegen.py
test_language_type_filter
TestAbstractGenerator
329
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...
'')
self.assertEqual
string_literal
tests/validators/test_attributes.py
test_target_namespace
TestXsd11Attributes
527
null
sissaschool/xmlschema
import unittest import os import pathlib from xml.etree import ElementTree from elementpath import XPath1Parser, XPath2Parser, Selector, LazyElementNode from xmlschema import XMLSchema10, XMLSchema11 from xmlschema.names import XSD_NAMESPACE from xmlschema.xpath import XMLSchemaProxy, XPathElement, split_path, Elemen...
'foo')
self.assertEqual
string_literal
tests/test_xpath.py
test_elem_name
XPathElementTest
188
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_value_constraint_property(self): ...
'beta')
self.assertEqual
string_literal
tests/validators/test_elements.py
test_value_constraint_property
TestXsdElements
109
null
sissaschool/xmlschema
import unittest import copy import xml.etree.ElementTree as ElementTree from pathlib import Path from typing import Dict from xmlschema import XMLSchema10, XMLSchema11, fetch_namespaces, etree_tostring, \ XMLSchemaValidationError, DataElement, DataElementConverter, XMLResource, \ XsdElement, XsdAttribute, XsdT...
8)
self.assertEqual
numeric_literal
tests/test_dataobjects.py
test_attributes_with_namespaces
TestDataElementInterface
73
null
sissaschool/xmlschema
import warnings from pathlib import Path from textwrap import dedent from xml.etree.ElementTree import Element from xmlschema import XMLSchemaParseError, XMLSchemaModelError from xmlschema.validators import XMLSchema11 from xmlschema.testing import XsdValidatorTestCase class TestXsd11ComplexType(TestXsdComplexType): ...
1)
self.assertEqual
numeric_literal
tests/validators/test_complex_types.py
test_sequence_extension
TestXsd11ComplexType
945
null
sissaschool/xmlschema
import pathlib from xmlschema import XMLSchemaParseError, XMLSchemaValidationError from xmlschema.names import XSD_LIST, XSD_UNION from xmlschema.validators import XMLSchema11 from xmlschema.testing import XsdValidatorTestCase class TestXsdSimpleTypes(XsdValidatorTestCase): cases_dir = pathlib.Path(__file__).par...
schema.types['emptyType1'].is_empty())
self.assertTrue
func_call
tests/validators/test_simple_types.py
test_is_empty
TestXsdSimpleTypes
174
null
sissaschool/xmlschema
import unittest import argparse import os.path import warnings from pathlib import Path from typing import Optional from xml.etree import ElementTree from xmlschema import validate, XMLSchema10, XMLSchema11, \ XMLSchemaException, XMLSchemaValidationError TEST_SUITE_NAMESPACE = "http://www.w3.org/XML/2004/xml-sche...
error)
self.assertIsNone
variable
tests/run_w3c_tests.py
test_xml_instances
TestGroupCase
489
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...
root.tag)
self.assertEqual
complex_expr
xmlschema/testing/_builders.py
check_decode_to_objects
TestValidator
519
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...
2)
self.assertEqual
numeric_literal
tests/validation/test_validation.py
test_decode
TestValidationMixin
140
null
sissaschool/xmlschema
from ._test_case_classes import XsdValidatorTestCase from ._observers import SchemaObserver OBJ_ID_PATTERN = re.compile(r" at 0x[0-9a-fA-F]+") def make_schema_test_class(test_file, test_args, test_num, schema_class, check_with_lxml): """ Creates a schema test class. :param test_file: the schema test file...
xml_root.tag)
self.assertEqual
complex_expr
xmlschema/testing/_builders.py
check_validation_with_generated_code
TestValidator
682
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...
'c')
self.assertEqual
string_literal
tests/test_codegen.py
test_type_name_filter
TestAbstractGenerator
440
null
sissaschool/xmlschema
import unittest import copy import xml.etree.ElementTree as ElementTree from pathlib import Path from typing import Dict from xmlschema import XMLSchema10, XMLSchema11, fetch_namespaces, etree_tostring, \ XMLSchemaValidationError, DataElement, DataElementConverter, XMLResource, \ XsdElement, XsdAttribute, XsdT...
[])
self.assertListEqual
collection
tests/test_dataobjects.py
test_iterchildren
TestDataObjects
214
null
sissaschool/xmlschema
import unittest from xml.etree import ElementTree from xmlschema import XMLSchemaParseError from xmlschema.names import XSD_NOTATION from xmlschema.validators import XMLSchema10, XMLSchema11, XsdNotation class TestXsd10Notations(unittest.TestCase): schema_class = XMLSchema10 def test_parse(self): sc...
str(ctx.exception))
self.assertIn
func_call
tests/validators/test_notations.py
test_parse
TestXsd10Notations
35
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...
orig)
self.assertIsNot
variable
tests/validators/test_xsd_globals.py
test_copy
TestXsd10GlobalsMaps
149
null
sissaschool/xmlschema
import warnings from pathlib import Path from textwrap import dedent from xml.etree.ElementTree import Element from xmlschema import XMLSchemaParseError, XMLSchemaModelError from xmlschema.validators import XMLSchema11 from xmlschema.testing import XsdValidatorTestCase class TestXsd11ComplexType(TestXsdComplexType): ...
3)
self.assertEqual
numeric_literal
tests/validators/test_complex_types.py
test_sequence_extension
TestXsd11ComplexType
933
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...
1)
self.assertEqual
numeric_literal
tests/validators/test_exceptions.py
test_sourceline_property
TestValidatorExceptions
235
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...
6)
self.assertEqual
numeric_literal
tests/test_utils.py
test_logged_decorator
TestUtils
809
null
sissaschool/xmlschema
import pathlib from xmlschema import XMLSchemaParseError, XMLSchemaValidationError from xmlschema.names import XSD_LIST, XSD_UNION from xmlschema.validators import XMLSchema11 from xmlschema.testing import XsdValidatorTestCase class TestXsdSimpleTypes(XsdValidatorTestCase): cases_dir = pathlib.Path(__file__).par...
schema.types['emptyType3'].is_empty())
self.assertTrue
func_call
tests/validators/test_simple_types.py
test_is_empty
TestXsdSimpleTypes
176
null
sissaschool/xmlschema
import pathlib import xml.etree.ElementTree as ElementTree from xmlschema import XMLSchemaParseError, XMLSchemaValidationError from xmlschema.validators import XMLSchema11 from xmlschema.validators.identities import IdentityCounter, KeyrefCounter, FieldValueSelector from xmlschema.testing import XsdValidatorTestCase ...
refer)
self.assertIs
variable
tests/validators/test_identities.py
test_keyref
TestXsdIdentities
204
null
sissaschool/xmlschema
import unittest import os import pathlib import platform import subprocess import sys import tempfile class TestMemoryUsage(unittest.TestCase): def get_memory_usage(output): if '-v' in sys.argv: sys.stdout.write(f'\n {output.strip()} ') return int(output.strip().rsplit('(')[-1][:-1]) ...
6 * 1024 ** 2)
self.assertLess
complex_expr
tests/run_memory_tests.py
test_element_tree_memory_usage
TestMemoryUsage
62
null
sissaschool/xmlschema
import unittest import importlib from pathlib import Path import elementpath class TestTyping(unittest.TestCase): def setUpClass(cls): cls.cases_dir = Path(__file__).parent.joinpath('test_cases/mypy') cls.config_file = Path(__file__).parent.parent.joinpath('pyproject.toml') def test_schema_s...
0)
self.assertEqual
numeric_literal
tests/run_typing_tests.py
test_schema_source
TestTyping
46
null
sissaschool/xmlschema
import io import unittest import os import contextlib import copy import pathlib import platform import warnings from io import StringIO, BytesIO from urllib.request import urlopen, build_opener, FileHandler from urllib.response import addinfourl from urllib.parse import urlsplit, uses_relative from pathlib import Path...
4)
self.assertEqual
numeric_literal
tests/test_resources.py
test_schema_resource_access
TestResources
1,200
null
sissaschool/xmlschema
import unittest import os import pathlib from xml.etree import ElementTree from elementpath import XPath1Parser, XPath2Parser, Selector, LazyElementNode from xmlschema import XMLSchema10, XMLSchema11 from xmlschema.names import XSD_NAMESPACE from xmlschema.xpath import XMLSchemaProxy, XPathElement, split_path, Elemen...
2)
self.assertEqual
numeric_literal
tests/test_xpath.py
test_xpath_subscription
XMLSchemaXPathTest
244
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...
'full')
self.assertEqual
string_literal
tests/validators/test_attributes.py
test_name_attribute
TestXsdAttributes
157
null
sissaschool/xmlschema
import unittest from unittest.mock import patch import glob import io import logging import pathlib import os import platform import sys import xmlschema from xmlschema.cli import get_loglevel, get_converter, validate, xml2json, json2xml from xmlschema.testing import run_xmlschema_tests WORK_DIRECTORY = os.getcwd() ...
'')
self.assertEqual
string_literal
tests/test_cli.py
test_validate_command_01
TestConsoleScripts
58
null
sissaschool/xmlschema
import unittest import filecmp import glob import os import re import pathlib import platform import tempfile import warnings from xmlschema import XMLSchema10, XMLSchema11 from xmlschema.exports import download_schemas from xmlschema.testing import SKIP_REMOTE_TESTS, XMLSchemaTestCase, run_xmlschema_tests class Test...
url_map)
self.assertEqual
variable
tests/test_exports.py
test_download_local_and_remote_schemas
TestDownloads
309
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...
0)
self.assertEqual
numeric_literal
tests/validators/test_attributes.py
test_name_attribute
TestXsdAttributes
150
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...
'c1')
self.assertEqual
string_literal
tests/validators/test_exceptions.py
test_invalid_child_property
TestValidatorExceptions
374
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...
1)
self.assertLessEqual
numeric_literal
tests/validators/test_builtins.py
test_facet_lists
TestXsd10BuiltinTypes
40
null
sissaschool/xmlschema
import warnings from pathlib import Path from textwrap import dedent from xml.etree.ElementTree import Element from xmlschema import XMLSchemaParseError, XMLSchemaModelError from xmlschema.validators import XMLSchema11 from xmlschema.testing import XsdValidatorTestCase class TestXsd11ComplexType(TestXsdComplexType): ...
2)
self.assertEqual
numeric_literal
tests/validators/test_complex_types.py
test_sequence_extension
TestXsd11ComplexType
937
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...
str)
self.assertIs
variable
tests/validators/test_exceptions.py
test_encode_error
TestValidatorExceptions
268
null
sissaschool/xmlschema
import unittest import argparse import os.path import warnings from pathlib import Path from typing import Optional from xml.etree import ElementTree from xmlschema import validate, XMLSchema10, XMLSchema11, \ XMLSchemaException, XMLSchemaValidationError TEST_SUITE_NAMESPACE = "http://www.w3.org/XML/2004/xml-sche...
validate_xml_instance())
self.assertIsNone
func_call
tests/run_w3c_tests.py
test_xml_instances
TestGroupCase
484
null
sissaschool/xmlschema
import pathlib from xmlschema import XMLSchemaParseError, XMLSchemaValidationError from xmlschema.names import XSD_LIST, XSD_UNION from xmlschema.validators import XMLSchema11 from xmlschema.testing import XsdValidatorTestCase class TestXsdSimpleTypes(XsdValidatorTestCase): cases_dir = pathlib.Path(__file__).par...
schema.types['notEmptyType1'].is_empty())
self.assertFalse
func_call
tests/validators/test_simple_types.py
test_is_empty
TestXsdSimpleTypes
177
null
sissaschool/xmlschema
import warnings from pathlib import Path from textwrap import dedent from xml.etree.ElementTree import Element from xmlschema import XMLSchemaParseError, XMLSchemaModelError from xmlschema.validators import XMLSchema11 from xmlschema.testing import XsdValidatorTestCase class TestXsd11ComplexType(TestXsdComplexType): ...
'a')
self.assertEqual
string_literal
tests/validators/test_complex_types.py
test_sequence_extension
TestXsd11ComplexType
930
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...
[])
self.assertEqual
collection
tests/validation/test_decoding.py
test_date_decoding
TestDecoding
643
null
sissaschool/xmlschema
import unittest import os import pathlib import platform import subprocess import sys import tempfile class TestMemoryUsage(unittest.TestCase): def get_memory_usage(output): if '-v' in sys.argv: sys.stdout.write(f'\n {output.strip()} ') return int(output.strip().rsplit('(')[-1][:-1]) ...
8 * 1024 ** 2)
self.assertLessEqual
complex_expr
tests/run_memory_tests.py
test_decode_memory_usage
TestMemoryUsage
95
null
sissaschool/xmlschema
import pathlib import unittest import re import os from textwrap import dedent from xml.etree.ElementTree import Element, iselement from xmlschema.exceptions import XMLSchemaValueError from xmlschema.names import XSD_NAMESPACE, XSI_NAMESPACE, XSD_SCHEMA from xmlschema.utils.qnames import get_namespace from xmlschema.r...
err)
self.assertIsNone
variable
xmlschema/testing/_test_case_classes.py
check_etree_elements
XsdValidatorTestCase
146
null
sissaschool/xmlschema
def check_elem_type(xsd_element: XsdElementProtocol) -> None: assert xsd_element.type is not
None
assert
none_literal
tests/test_cases/mypy/protocols.py
check_elem_type
29
null
sissaschool/xmlschema
import sys import unittest import logging import warnings import pathlib import pickle import os from textwrap import dedent from xml.etree.ElementTree import Element import xmlschema from xmlschema import XMLSchemaParseError, XMLSchemaIncludeWarning, XMLSchemaImportWarning from xmlschema.names import XML_NAMESPACE, X...
[])
self.assertEqual
collection
tests/validators/test_schemas.py
test_schema_location_hints
TestXMLSchema10
102
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...
2)
self.assertEqual
numeric_literal
tests/test_wsdl.py
test_wsdl_document_imports
TestWsdlDocuments
414
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...
str)
self.assertIsInstance
variable
tests/validation/test_encoding.py
test_datetime_builtin_type
TestEncoding
190
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...
ast.Module)
self.assertIsInstance
complex_expr
xmlschema/testing/_builders.py
check_validation_with_generated_code
TestValidator
656
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...
1)
self.assertEqual
numeric_literal
tests/validation/test_decoding.py
test_date_decoding
TestDecoding
652
null
sissaschool/xmlschema
import pathlib import xml.etree.ElementTree as ElementTree from xmlschema import XMLSchemaParseError, XMLSchemaValidationError from xmlschema.validators import XMLSchema11 from xmlschema.validators.identities import IdentityCounter, KeyrefCounter, FieldValueSelector from xmlschema.testing import XsdValidatorTestCase ...
key1)
self.assertIsNot
variable
tests/validators/test_identities.py
test_key_reference_definition
TestXsd11Identities
408
null
sissaschool/xmlschema
import unittest import sys import os import ntpath import pathlib import platform import posixpath import warnings from string import ascii_letters from urllib.parse import urlsplit from urllib.request import pathname2url from pathlib import Path, PurePath, PureWindowsPath, PurePosixPath from unittest.mock import patc...
'.')
self.assertEqual
string_literal
tests/test_locations.py
test_path_from_uri
TestLocations
179
null
sissaschool/xmlschema
import unittest import filecmp import glob import os import re import pathlib import platform import tempfile import warnings from xmlschema import XMLSchema10, XMLSchema11 from xmlschema.exports import download_schemas from xmlschema.testing import SKIP_REMOTE_TESTS, XMLSchemaTestCase, run_xmlschema_tests class Test...
{})
self.assertEqual
collection
tests/test_exports.py
test_download_local_schemas
TestDownloads
287
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....
version == match.group(1).strip('\'\"'))
self.assertTrue
func_call
tests/test_package.py
test_version
TestPackaging
106
null
sissaschool/xmlschema
import unittest import os import pathlib from xml.etree import ElementTree from elementpath import XPath1Parser, XPath2Parser, Selector, LazyElementNode from xmlschema import XMLSchema10, XMLSchema11 from xmlschema.names import XSD_NAMESPACE from xmlschema.xpath import XMLSchemaProxy, XPathElement, split_path, Elemen...
bike)
self.assertIsNotNone
variable
tests/test_xpath.py
test_iterfind
XMLSchemaXPathTest
302
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....
et.ElementTree)
self.assertIsInstance
complex_expr
tests/test_package.py
test_base_schema_files
TestPackaging
132
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...
error.obj)
self.assertIsNone
complex_expr
tests/validation/test_validation.py
test_validation_error
TestValidationContext
103
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 TestLoadersAPI(XMLSchemaTestCase...
[])
self.assertListEqual
collection
tests/test_loaders.py
test_get_namespaces
TestLoadersAPI
31
null
sissaschool/xmlschema
import pathlib from xmlschema import XMLSchemaParseError, XMLSchemaValidationError from xmlschema.names import XSD_LIST, XSD_UNION from xmlschema.validators import XMLSchema11 from xmlschema.testing import XsdValidatorTestCase class TestXsd11SimpleTypes(TestXsdSimpleTypes): schema_class = XMLSchema11 def te...
schema.types['Percentage'].is_valid('0'))
self.assertTrue
func_call
tests/validators/test_simple_types.py
test_assertion_facet
TestXsd11SimpleTypes
312
null
sissaschool/xmlschema
import unittest import decimal import pathlib from xml.etree import ElementTree from textwrap import dedent from xmlschema import XMLSchema10, XMLSchema11, XMLSchemaValidationError, \ XMLSchemaParseError from xmlschema.names import XSD_NAMESPACE, XSD_LENGTH, XSD_MIN_LENGTH, XSD_MAX_LENGTH, \ XSD_WHITE_SPACE, X...
1)
self.assertEqual
numeric_literal
tests/validators/test_facets.py
test_pattern_facet
TestXsdFacets
1,057
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...
text)
self.assertEqual
variable
tests/validation/test_encoding.py
test_error_message
TestEncoding
389
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...
']')
self.assertEqual
string_literal
tests/validation/test_decoding.py
test_json_path_decoding
TestDecoding
741
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...
a)
self.assertIs
variable
tests/validators/test_models.py
test_particle_occurs_check_methods
TestModelValidation
1,115
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....
match)
self.assertIsNone
variable
tests/test_package.py
test_forgotten_debug_statements
TestPackaging
63
null
sissaschool/xmlschema
import unittest import sys import os import ntpath import pathlib import platform import posixpath import warnings from string import ascii_letters from urllib.parse import urlsplit from urllib.request import pathname2url from pathlib import Path, PurePath, PureWindowsPath, PurePosixPath from unittest.mock import patc...
'nt')
self.assertEqual
string_literal
tests/test_locations.py
test_normalize_url_with_base_unc_path_on_windows
TestLocations
427
null
sissaschool/xmlschema
import pathlib import unittest import re import os from textwrap import dedent from xml.etree.ElementTree import Element, iselement from xmlschema.exceptions import XMLSchemaValueError from xmlschema.names import XSD_NAMESPACE, XSI_NAMESPACE, XSD_SCHEMA from xmlschema.utils.qnames import get_namespace from xmlschema.r...
expected(schema))
self.assertTrue
func_call
xmlschema/testing/_test_case_classes.py
check_schema
XsdValidatorTestCase
170
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,...
0)
self.assertEqual
numeric_literal
tests/test_documents.py
test_to_json_api
TestXmlDocuments
72
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...
'1')
self.assertEqual
string_literal
tests/validation/test_encoding.py
test_element_encoding_with_defaults__issue_218
TestEncoding
599
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...
errors[0])
self.assertIs
complex_expr
tests/validation/test_validation.py
test_optional_errors_collector
TestValidation11
756
null
sissaschool/xmlschema
import pathlib import unittest import re import os from textwrap import dedent from xml.etree.ElementTree import Element, iselement from xmlschema.exceptions import XMLSchemaValueError from xmlschema.names import XSD_NAMESPACE, XSI_NAMESPACE, XSD_SCHEMA from xmlschema.utils.qnames import get_namespace from xmlschema.r...
e.path)
self.assertTrue
complex_expr
xmlschema/testing/_test_case_classes.py
check_errors
XsdValidatorTestCase
183
null
sissaschool/xmlschema
import io import unittest import copy from textwrap import dedent from xmlschema import XMLResource, XMLSchemaConverter from xmlschema.locations import get_locations from xmlschema.names import XSD_NAMESPACE, XSI_NAMESPACE from xmlschema.namespaces import NamespaceMapper from xmlschema.locations import NamespaceResour...
1)
self.assertEqual
numeric_literal
tests/test_namespaces.py
test_dictionary_methods
TestNamespaceMapper
52
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...
str)
self.assertIsInstance
variable
tests/validation/test_decoding.py
test_json_path_decoding
TestDecoding
738
null