File: //var/opt/nydus/ops/jsonschema/tests/__pycache__/test_deprecations.cpython-39.pyc
a
�,�h�= � @ s� d dl mZ d dlmZ d dlmZmZ d dlZd dl Z d dl
Z
d dlZd dlZ
d dlZd dlmZmZmZmZ G dd� de�ZdS )� )�contextmanager)�BytesIO)�TestCase�mockN)�
FormatChecker�
exceptions� protocols�
validatorsc @ 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)d*� Zd+d,� Zd-d.� Zd/S )0�TestDeprecationsc C sb d}| � t|��}ddlm} W d � n1 s20 Y | �|tj�d�� | �|jt � dS )zY
As of v4.0.0, __version__ is deprecated in favor of importlib.metadata.
z.Accessing jsonschema.__version__ is deprecatedr )�__version__N�
jsonschema)
�assertWarnsRegex�DeprecationWarningr r �assertEqual� importlib�metadata�version�filename�__file__)�self�message�wr � r �S/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/jsonschema/tests/test_deprecations.py�test_version s
*zTestDeprecations.test_versionc C s\ d}| � t|��}ddlm} W d � n1 s20 Y | �|tj� | �|jt� dS )z�
As of v4.0.0, importing ErrorTree from jsonschema.validators is
deprecated in favor of doing so from jsonschema.exceptions.
z2Importing ErrorTree from jsonschema.validators is r �� ErrorTreeN)r
r �jsonschema.validatorsr r r r r �r r r r r r r �test_validators_ErrorTree s
*z*TestDeprecations.test_validators_ErrorTreec C s\ d}| � t|��}ddlm} W d � n1 s20 Y | �|tj� | �|jt� dS )z�
As of v4.18.0, importing ErrorTree from the package root is
deprecated in favor of doing so from jsonschema.exceptions.
z9Importing ErrorTree directly from the jsonschema package r r N)r
r r r r r r r r r r r �test_import_ErrorTree) s
*z&TestDeprecations.test_import_ErrorTreec C s� t jddgd�}t �� }t j|gd�}d}| �t|��}||d<