コード例 #1
0
def test_is_collection(type_name: str, feature_name: str, expected: bool):
    typesystem = TypeSystem()
    t = typesystem.get_type(type_name)
    feature = Feature("test_feature", rangeTypeName=feature_name)
    t.add_feature(feature)

    assert typesystem.is_collection(type_name, feature) == expected
コード例 #2
0
def test_is_collection_for_builtin_collections_with_elements(type_name: str):
    typesystem = TypeSystem()
    t = typesystem.get_type(type_name)
    feature = Feature("elements", rangeTypeName="uima.cas.TOP")

    assert typesystem.is_collection(type_name, feature) is True
コード例 #3
0
def test_is_collection(type_name: str, expected: bool):
    typesystem = TypeSystem()

    assert typesystem.is_collection(type_name) == expected