�
�r�c� � � � d Z ddlmZ ddlmZmZmZ ddlmZ e d� � Z
ed� � Zd� Z
G d� d e� � Zd
S )zH
Tests for the parts of jsonschema related to the :kw:`format` keyword.
� )�TestCase)�
FormatChecker�FormatError�ValidationError)�Draft4ValidatorzBoom!zBang!c �* � | dk rt �t �)N�bang)�BANG�BOOM��things �>/usr/lib/python3/dist-packages/jsonschema/tests/test_format.py�boomr s � ������
�
�J� c �J � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� ZdS )�TestFormatCheckerc �Z � t d�� � }| � |j � � d S )N� ��formats)r �assertFalse�checkers��self�checkers r �test_it_can_validate_no_formatsz1TestFormatChecker.test_it_can_validate_no_formats s/ � ���+�+�+������)�*�*�*�*�*r c � � | � t � � 5 t dg�� � d d d � � d S # 1 swxY w Y d S )Nzo noesr )�assertRaises�KeyErrorr )r s r �.test_it_raises_a_key_error_for_unknown_formatsz@TestFormatChecker.test_it_raises_a_key_error_for_unknown_formats s� � �
�
�
�x�
(�
(� .� .��8�*�-�-�-�-� .� .� .� .� .� .� .� .� .� .� .� .���� .� .� .� .� .� .s
�:�>�>c �2 � t t j � � }| � t j j d� � t j d� � t � � | � t j t |t df�� � � � d S �Nr r )r )�dictr r �
addCleanup�pop�
cls_checksr �assertEqual)r �originals r �!test_it_can_register_cls_checkersz3TestFormatChecker.test_it_can_register_cls_checkers s� � ��
�.�/�/�����
�.�2�F�;�;�;�(�
� ��(�(��.�.�.�����"����r�
�+�+�+�
�
�
�
�
r c �� � t � � } |� d� � t � � | � |j t t j t df�� � � � d S r" |