3 ��kS� � @ s| d dl Z d dlZd dlZd dlmZmZmZ d dlmZ G dd� dej �Z G dd� dej �Zdd � Ze d krxejd d� dS )� N)�Markup�escape� escape_silent)� text_typec @ s� e Zd Zdd� Zdd� Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z ejd"krZdd� Z dd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!S )#�MarkupTestCasec C s0 d}t d�}|| tt|��t|� ks,t�d S )Nz?<script type="application/x-some-script">alert("foo");</script>z<em>username</em>)r r r �AssertionError)�selfZunsafeZsafe� r �/usr/lib64/python3.6/tests.py�test_adding s zMarkupTestCase.test_addingc C sX t d�d dkst�t d�ddi dks,t�t d�d dks@t�t d �d d ksTt�d S )Nz<em>%s</em>z <bad user>z<em><bad user></em>z<em>%(username)s</em>�usernamez%ig��Q� @�3z%.2fz3.14)r r )r r r r �test_string_interpolation s z(MarkupTestCase.test_string_interpolationc C s4 t td�d �tkst�td�}|j� |ks0t�d S )N�foo�bar)�typer r �__html__)r �xr r r �test_type_behavior s z!MarkupTestCase.test_type_behaviorc C s<