3 �}:a� � @ s� d Z ddlZddlZddlmZ G dd� dej�ZG dd� dej�ZG dd � d ej�ZG d d� dej�Z G dd � d ej�Z edkr�ej� dS )zTests for josepy.util.� N)� test_utilc @ sH e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dS )�ComparableX509Testz%Tests for josepy.util.ComparableX509.c C sL t jd�| _t jd�| _t jd�| _t jd�| _t jd�| _t jd�| _d S )Nzcsr.pemzcsr-san.pemzcert.pemzcert-san.pem) r Zload_comparable_csr�req1�req2� req_otherZload_comparable_cert�cert1�cert2� cert_other)�self� r �/usr/lib/python3.6/util_test.py�setUp s zComparableX509Test.setUpc C s | j | jj� d� d S )NT)�assertIsr Zhas_expired)r r r r �test_getattr_proxy s z%ComparableX509Test.test_getattr_proxyc C s$ | j | j| j� | j | j| j� d S )N)�assertEqualr r r r )r r r r �test_eq s zComparableX509Test.test_eqc C s$ | j | j| j� | j | j| j� d S )N)�assertNotEqualr r r r )r r r r �test_ne s zComparableX509Test.test_nec C s | j | jd� | j | jd� d S )N� )r r r )r r r r �test_ne_wrong_types! s z&ComparableX509Test.test_ne_wrong_typesc C sd | j t| j�t| j�� | jt| j�t| j�� | j t| j�t| j�� | jt| j�t| j�� d S )N) r �hashr r r r r r r )r r r r � test_hash% s zComparableX509Test.test_hashc C s2 x,| j | jfD ]}| jt|�dj|j�� qW d S )Nz<ComparableX509({0!r})>)r r r �repr�format�wrapped)r Zx509r r r � test_repr, s zComparableX509Test.test_reprN)�__name__� __module__�__qualname__�__doc__r r r r r r r r r r r r s r c @ s` e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� Zdd� Z dS )�ComparableRSAKeyTestz'Tests for josepy.util.ComparableRSAKey.c C s( t jd�| _t jd�| _t jd�| _d S )Nzrsa256_key.pemzrsa512_key.pem)r Zload_rsa_private_key�key�key_same�key2)r r r r r 5 s zComparableRSAKeyTest.setUpc C s | j d| jj� d S )N� )r r! �key_size)r r r r r ; s z'ComparableRSAKeyTest.test_getattr_proxyc C s | j | j| j� d S )N)r r! r"