Makes sure that the enclosing characters for a definition set make sense
    1) There is only one set
    2) They are in the right order (opening, then closing)

def _check_enclosing_characters(string, opener, closer):
    """
    Makes sure that the enclosing characters for a definition set make sense
    1) There is only one set
    2) They are in the right order (opening, then closing)
    """
    opener_count = string.count(opener)
    closer_count = string.count(closer)
    total = opener_count + closer_count
    if total > 2:
        msg = MORE_THAN_ONE_SET.format(opener, closer)
        raise ValueError(msg)
    elif total == 1:
        msg = INCOMPLETE_SET.format(opener, closer)
        raise ValueError(msg)
    elif opener_count > 1:
        msg = INCORRECT_SET_CONSTITUENT.format(opener)
        raise ValueError(msg)
    elif closer_count > 1:
        msg = INCORRECT_SET_CONSTITUENT.format(closer)
        raise ValueError(msg)