�
�r�c�J � � � d dl mZ d dlZd dlmZ d dlmZ G d� de� � Z G d� de� � Z G d � d
e� � Z G d� de� � Z
G d
� de� � ZdS )� )�TestCaseN)�
exceptions)�_LATEST_VERSIONc �n � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
d� Zd
� Zd� Zd� Zd� ZdS )�
TestBestMatchc �j � t t |� � � |� � � � }t j t |� � � � }t j t
|� � � � }| � |� � � |� � � d|� d|� �� � |S )NzNo consistent best match!
Got: z
Then: ) �listr �iter_errorsr �
best_match�iter�reversed�assertEqual� _contents)�self�instance�schema�errors�best�
reversed_bests �B/usr/lib/python3/dist-packages/jsonschema/tests/test_exceptions.py�
best_match_ofzTestBestMatch.best_match_of s� � ��o�f�-�-�9�9�(�C�C�D�D���$�T�&�\�\�2�2��"�-�h�v�.>�.>�?�?�
�����N�N����#�#�%�%�N�t�N�N�}�N�N�
�
�
�
�� c � � ddddddiid�ii}| � ddg ii|�� � }| � |j d � � d S )
N�
properties�foo� �bar�type�object)�
minPropertiesr �r r r �r r � validator�r r r s r �(test_shallower_errors_are_better_matchesz6TestBestMatch.test_shallower_errors_are_better_matches so � ���%&�#(�6�8�*<�"=�� ��
�� �!�!�E�E�2�;�+?��!�O�O��������9�9�9�9�9r c � � dddiddigddiddigd�}| � i |�� � }| � |j d� � dS ) zn
A property you *must* match is probably better than one you have to
match a part of.
r r �string�number)r �anyOf�oneOfr! r Nr" |