def test_imports_01():
    """Test importing packages - 1."""
    for mod in (
        pyesdoc,
        pyesdoc.archive,
        pyesdoc.archive.config,
        pyesdoc.constants,
        pyesdoc.factory,
        pyesdoc.io,
        pyesdoc.ontologies,
        pyesdoc.ontologies.cim.v1,
        pyesdoc.ontologies.cim.v2,
        pyesdoc.options,
        pyesdoc.extensions,
        pyesdoc.extensions.default,
        pyesdoc.extensions.extender,
        pyesdoc.publishing,
        pyesdoc.serialization,
        pyesdoc.utils,
        pyesdoc.utils.convert,
        pyesdoc.utils.runtime,
        pyesdoc.validation,
        pyesdoc.validation.graph,
        pyesdoc.validation.validator,
        ):
        tu.init(_test_import, "import module", mod)
        yield _test_import, mod
def test_retrieve():
	"""ES-DOC :: WS :: Test retrieving a previously published document.

	"""
	for encoding in pyesdoc.ENCODINGS_HTTP:
		tu.init(_test_retrieve, 'retrieval', suffix=encoding)
		yield _test_retrieve, encoding
Exemple #3
0
def test_imports_02():
    """Test importing packages - 2."""
    cim = pyesdoc.ontologies.cim
    for mod in (
            cim,
            cim.v1,
            cim.v1.decoder,
            cim.v1.decoder_for_activity_package,
            cim.v1.decoder_for_data_package,
            cim.v1.decoder_for_grids_package,
            cim.v1.decoder_for_misc_package,
            cim.v1.decoder_for_quality_package,
            cim.v1.decoder_for_shared_package,
            cim.v1.decoder_for_software_package,
            cim.v1.typeset,
            cim.v1.typeset_for_activity_package,
            cim.v1.typeset_for_data_package,
            cim.v1.typeset_for_grids_package,
            cim.v1.typeset_for_misc_package,
            cim.v1.typeset_for_quality_package,
            cim.v1.typeset_for_shared_package,
            cim.v1.typeset_for_software_package,
            cim.v1.typeset_meta,
    ):
        tu.init(_test_import, "import cim module", mod)
        yield _test_import, mod
Exemple #4
0
def test_imports_02():
    """Test importing packages - 2."""
    cim = pyesdoc.ontologies.cim
    for mod in (
        cim,
        cim.v1,
        cim.v1.decoder,
        cim.v1.decoder_for_activity_package,
        cim.v1.decoder_for_data_package,
        cim.v1.decoder_for_grids_package,
        cim.v1.decoder_for_misc_package,
        cim.v1.decoder_for_quality_package,
        cim.v1.decoder_for_shared_package,
        cim.v1.decoder_for_software_package,
        cim.v1.typeset,
        cim.v1.typeset_for_activity_package,
        cim.v1.typeset_for_data_package,
        cim.v1.typeset_for_grids_package,
        cim.v1.typeset_for_misc_package,
        cim.v1.typeset_for_quality_package,
        cim.v1.typeset_for_shared_package,
        cim.v1.typeset_for_software_package,
        cim.v1.typeset_meta,
        ):
        tu.init(_test_import, "import cim module", mod)
        yield _test_import, mod
def test():
    """Runs set of factory unit tests."""
    for func in (
        _test_create_01,
        _test_create_02,
        ):
        tu.init(func, func.__doc__[5:])
        yield func
def test():
    """Test serialization of documents containing non-ascii characters."""
    for func in (
        _test_xml_serialization,
        _test_json_serialization,
        ):
        tu.init(func, func.__doc__[5:])
        yield func
def test():
    """Test serialization of documents containing non-ascii characters."""
    for func in (
            _test_xml_serialization,
            _test_json_serialization,
    ):
        tu.init(func, func.__doc__[5:])
        yield func
Exemple #8
0
def test():
    """Runs set of factory unit tests."""
    for func in (
        _test_create_01,
        _test_create_02,
        _test_create_03,
        ):
        tu.init(func, func.__doc__[5:])
        yield func
def test():
    """Runs set of archive unit tests."""
    for func in (
        _test_archive_config,
        _test_archive_doc_dirs,
        _test_archive_get_counts
        ):
        tu.init(func, func.__doc__[5:])
        yield func
def test():
    """Performs extension tests over the set of test documents."""
    for func in (
        _test_custom_extender_count,
        _test_is_custom_extendable,
        ):
        tu.init(func, func.__doc__[5:])
        yield func

    for mod in tt.MODULES:
        tu.init(_test, 'extensions', mod)
        yield _test, mod
Exemple #11
0
def test():
    """Performs extension tests over the set of test documents."""
    for func in (
            _test_custom_extender_count,
            _test_is_custom_extendable,
    ):
        tu.init(func, func.__doc__[5:])
        yield func

    for mod in tt.MODULES:
        tu.init(_test, 'extensions', mod)
        yield _test, mod
Exemple #12
0
def test():
    """Runs set of geenral unit tests."""
    for mod in tt.MODULES:
        tu.init(_test_module_file_open, 'open document module test file', mod)
        yield _test_module_file_open, mod

    for mod in tt.MODULES:
        tu.init(_test_module_reset, 'document module reset', mod)
        yield _test_module_reset, mod

    for mod in tt.MODULES:
        tu.init(_test_module_setup, 'document module setup', mod)
        yield _test_module_setup, mod

    for func in (
        _test_version,
        _test_set_option_01,
        _test_set_option_02,
        _test_is_supported_ontology,
        _test_is_supported_type_01,
        _test_is_supported_type_02,
        _test_list_types,
        ):
        tu.init(func, func.__doc__[5:])
        yield func
Exemple #13
0
def test():
    """Runs set of geenral unit tests."""
    for mod in tt.MODULES:
        tu.init(_test_module_file_open, 'open document module test file', mod)
        yield _test_module_file_open, mod

    for mod in tt.MODULES:
        tu.init(_test_module_reset, 'document module reset', mod)
        yield _test_module_reset, mod

    for mod in tt.MODULES:
        tu.init(_test_module_setup, 'document module setup', mod)
        yield _test_module_setup, mod

    for func in (
            _test_version,
            _test_set_option_01,
            _test_set_option_02,
            _test_is_supported_ontology,
            _test_is_supported_type_01,
            _test_is_supported_type_02,
            _test_list_types,
    ):
        tu.init(func, func.__doc__[5:])
        yield func
Exemple #14
0
def test_imports_01():
    """Test importing packages - 1."""
    for mod in (
            pyesdoc,
            pyesdoc.constants,
            pyesdoc.factory,
            pyesdoc.io,
            pyesdoc.ontologies,
            pyesdoc.options,
            pyesdoc.extensions,
            pyesdoc.extensions.default,
            pyesdoc.extensions.extender,
            pyesdoc.publishing,
            pyesdoc.serialization,
            pyesdoc.utils,
            pyesdoc.utils.convert,
            pyesdoc.utils.functional,
            pyesdoc.utils.runtime,
            pyesdoc.validation,
            pyesdoc.validation.graph,
            pyesdoc.validation.validator,
    ):
        tu.init(_test_import, "import module", mod)
        yield _test_import, mod
def test():
    """Performs serialization tests over the set of test documents."""
    for mod in tt.MODULES:
        # Get doc instance.
        doc = tu.get_doc(mod)

        # Test json.
        tu.init(_test, 'serialization', mod, 'JSON')
        yield _test, mod, doc, pyesdoc.ENCODING_JSON

        # Test xml.
        tu.init(_test, 'serialization', mod, 'XML')
        yield _test, mod, doc, pyesdoc.ENCODING_XML

        # Test metafor cim v1 xml.
        tu.init(_test_metafor_xml, 'serialization', mod, 'XML Metafor CIM v1')
        yield _test_metafor_xml, doc

        # Test html.
        tu.init(_test_html, 'serialization', mod, 'HTML')
        yield _test_html, mod, doc
Exemple #16
0
def test():
    """Performs serialization tests over the set of test documents."""
    for mod in tt.MODULES:
        # Get doc instance.
        doc = tu.get_doc(mod)

        # Test json.
        tu.init(_test, 'serialization', mod, 'JSON')
        yield _test, mod, doc, pyesdoc.ESDOC_ENCODING_JSON

        # Test xml.
        tu.init(_test, 'serialization', mod, 'XML')
        yield _test, mod, doc, pyesdoc.ESDOC_ENCODING_XML

        # Test metafor cim v1 xml.
        tu.init(_test_metafor_xml, 'serialization', mod, 'XML Metafor CIM v1')
        yield _test_metafor_xml, doc

        # Test html.
        tu.init(_test_html, 'serialization', mod, 'HTML')
        yield _test_html, mod, doc
def test():
    """Performs validation tests over the set of test documents."""
    for mod in tt.MODULES:
        tu.init(_test, 'validation', mod)
        yield _test, mod
def test():
    """Performs publishing workflow tests over the set of test documents."""
    _set_api_url('dev')
    for mod in tt.MODULES:
        tu.init(_test, 'publishing', mod)
        yield _test, mod
def test():
    """Performs validation tests over the set of test documents."""
    for mod in tt.MODULES:
        tu.init(_test, "validation", mod)
        yield _test, mod