# Path: delphin/semi.py
# TOP_TYPE = '*top*'
# STRING_TYPE = 'string'
# _SEMI_SECTIONS = (
#     'variables',
#     'properties',
#     'roles',
#     'predicates',
# )
# class SemIError(PyDelphinException):
# class SemISyntaxError(PyDelphinSyntaxError):
# class SemIWarning(PyDelphinWarning):
# class SynopsisRole(tuple):
# class Synopsis(tuple):
# class SemI(object):
# def load(source, encoding='utf-8'):
# def _read_file(path, basedir, encoding):
# def _incorporate(d, key, val, path):
#     def __new__(cls, name, value, properties=None, optional=False):
#     def __repr__(self):
#     def _to_dict(self):
#     def _from_dict(cls, d):
#     def __repr__(self):
#     def from_dict(cls, d):
#     def to_dict(self):
#     def subsumes(self, args, variables=None):
#     def __init__(self,
#                  variables=None,
#                  properties=None,
#                  roles=None,
#                  predicates=None):
#     def _init_properties(self, properties):
#     def _init_variables(self, variables):
#     def _init_roles(self, roles):
#     def _init_predicates(self, predicates):
#     def _init_synopsis(self, pred, synopsis_data, propcache):
#     def from_dict(cls, d):
#     def to_dict(self):
#         def add_parents(d, ps):
#     def find_synopsis(self, predicate, args=None):
# def _new_hierarchy():


import pytest
from delphin import semi
    from delphin import hierarchy
    with pytest.raises(hierarchy.HierarchyError):
        semi.SemI(variables={'u': {'parents': []},
                             'i': {'parents': ['u', 'i']}})
    # undeclared variable
    with pytest.raises(semi.SemIError):
        semi.SemI(roles={'ARG0': {'value': 'i'}})
    # undeclared role
    with pytest.raises(semi.SemIError):
        semi.SemI(
            variables={'u': {'parents': []},
                       'i': {'parents': ['u']}},
            predicates={
                '_predicate_n_1': {
                    'parents': [],
                    'synopses': [
                        {'roles': [{'name': 'ARG0', 'value': 'i'}]}]}})
    # undeclared properties
    with pytest.raises(semi.SemIError):
        semi.SemI(
            variables={'u': {'parents': []},
                       'i': {'parents': ['u']}},
            roles={'ARG0': {'value': 'i'}},
            predicates={
                '_predicate_n_1': {
                    'parents': [],
                    'synopses': [
                        {'roles': [{'name': 'ARG0',
                                    'value': 'i',
                                    'properties': {'IND': '+'}}]}]}})
    # undeclared property value

# Path: delphin/semi.py
# TOP_TYPE = '*top*'
# STRING_TYPE = 'string'
# _SEMI_SECTIONS = (
#     'variables',
#     'properties',
#     'roles',
#     'predicates',
# )
# class SemIError(PyDelphinException):
# class SemISyntaxError(PyDelphinSyntaxError):
# class SemIWarning(PyDelphinWarning):
# class SynopsisRole(tuple):
# class Synopsis(tuple):
# class SemI(object):
# def load(source, encoding='utf-8'):
# def _read_file(path, basedir, encoding):
# def _incorporate(d, key, val, path):
#     def __new__(cls, name, value, properties=None, optional=False):
#     def __repr__(self):
#     def _to_dict(self):
#     def _from_dict(cls, d):
#     def __repr__(self):
#     def from_dict(cls, d):
#     def to_dict(self):
#     def subsumes(self, args, variables=None):
#     def __init__(self,
#                  variables=None,
#                  properties=None,
#                  roles=None,
#                  predicates=None):
#     def _init_properties(self, properties):
#     def _init_variables(self, variables):
#     def _init_roles(self, roles):
#     def _init_predicates(self, predicates):
#     def _init_synopsis(self, pred, synopsis_data, propcache):
#     def from_dict(cls, d):
#     def to_dict(self):
#         def add_parents(d, ps):
#     def find_synopsis(self, predicate, args=None):
# def _new_hierarchy():


# Path: tests/semi_test.py
import pytest
from delphin import semi
    from delphin import hierarchy

    with pytest.raises(hierarchy.HierarchyError):
        semi.SemI(variables={'u': {'parents': []},
                             'i': {'parents': ['u', 'i']}})
    # undeclared variable
    with pytest.raises(semi.SemIError):
        semi.SemI(roles={'ARG0': {'value': 'i'}})
    # undeclared role
    with pytest.raises(semi.SemIError):
        semi.SemI(
            variables={'u': {'parents': []},
                       'i': {'parents': ['u']}},
            predicates={
                '_predicate_n_1': {
                    'parents': [],
                    'synopses': [
                        {'roles': [{'name': 'ARG0', 'value': 'i'}]}]}})
    # undeclared properties
    with pytest.raises(semi.SemIError):
        semi.SemI(
            variables={'u': {'parents': []},
                       'i': {'parents': ['u']}},
            roles={'ARG0': {'value': 'i'}},
            predicates={
                '_predicate_n_1': {
                    'parents': [],
                    'synopses': [
                        {'roles': [{'name': 'ARG0',
                                    'value': 'i',
                                    'properties': {'IND': '+'}}]}]}})
    # undeclared property value

    with pytest.raises(semi.SemIError):