File: //var/opt/nydus/ops/jsonschema/tests/__pycache__/test_exceptions.cpython-39.pyc
a
�,�h�^ � @ s� d dl mZ d dlZd dlZd dlmZ d dlmZ G dd� de�ZG dd� de�Z G d d
� d
e�Z
G dd� de�ZG d
d� de�ZG dd� de�Z
dS )� )�TestCaseN)�
exceptions)�_LATEST_VERSIONc @ s� e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)S )*�
TestBestMatchc C st t t|��|��}d|� d|�d�}| j||d� t�t|��}t�t|��}| �|� � |� � d|� d|� �� |S )NzNo errors found for z under �!)�msgzNo consistent best match!
Got: z
Then: )
�listr �iter_errors�
assertTruer �
best_match�iter�reversed�assertEqualZ _contents)�self�instance�schema�errorsr �bestZ
reversed_best� r �Q/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/jsonschema/tests/test_exceptions.py�
best_match_of s �zTestBestMatch.best_match_ofc C sB ddddddiid�ii}| j ddg ii|d�}| �|jd � d S )
N�
properties�foo� �bar�type�object)�
minPropertiesr �r r r �r r � validator�r r r r r r �(test_shallower_errors_are_better_matches s
���z6TestBestMatch.test_shallower_errors_are_better_matchesc C sD dddiddigddiddigd�}| j i |d�}| �|jd� 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 r! r r r �%test_oneOf_and_anyOf_are_weak_matches&