Пример #1
0
def _test_list_types():
    """Test listing supported types."""
    # supported - all
    types = pyesdoc.list_types()
    tu.assert_int(len(types), 103)

    # supported - cim v1
    types = pyesdoc.list_types(_CIM, _CIM_V1)
    tu.assert_int(len(types), 103)

    # unsupported
    types = pyesdoc.list_types('x', 'x')
    tu.assert_int(len(types), 0)
Пример #2
0
def _test_list_types():
    """Test listing supported types."""
    # supported - all
    types = pyesdoc.list_types()
    tu.assert_int(len(types), 103)

    # supported - cim v1
    types = pyesdoc.list_types(_CIM, _CIM_V1)
    tu.assert_int(len(types), 103)

    # unsupported
    types = pyesdoc.list_types('x', 'x')
    tu.assert_int(len(types), 0)
Пример #3
0
def _test_create_02():
    """Test creating documents - 2."""
    for ontology, version, package, typeof in pyesdoc.list_types():
        doc = _create_doc(ontology, version, package, typeof)
        _assert_doc(doc)
        type_key = "{0}.{1}.{2}.{3}".format(ontology, version, package, typeof)
        tu.assert_str(doc.__class__.type_key, type_key)
Пример #4
0
def _test_create_02():
    """Test creating documents - 2."""
    for ontology, version, package, typeof in pyesdoc.list_types():
        doc = _create_doc(ontology, version, package, typeof)
        _assert_doc(doc)
        type_key = "{0}.{1}.{2}.{3}".format(ontology, version, package, typeof)
        tu.assert_str(doc.__class__.type_key, type_key)
Пример #5
0
def _test_is_supported_type_01():
    """Test supported ontology types - positive."""
    # supported
    assert pyesdoc.is_supported(_CIM, _CIM_V1, _CIM_PACKAGE, _CIM_TYPE)
    for ontology, version, package, typeof in pyesdoc.list_types():
        assert pyesdoc.is_supported(ontology, version, package, typeof)
Пример #6
0
def _test_is_supported_type_01():
    """Test supported ontology types - positive."""
    # supported
    assert pyesdoc.is_supported(_CIM, _CIM_V1, _CIM_PACKAGE, _CIM_TYPE)
    for ontology, version, package, typeof in pyesdoc.list_types():
        assert pyesdoc.is_supported(ontology, version, package, typeof)