Current File : //usr/lib/python3/dist-packages/twisted/web/test/__pycache__/test_template.cpython-312.pyc |
�
Ϫ�f�q � � � d Z ddlZddlmZ ddlmZmZ ddlmZ ddl m
Z
ddlmZm
Z
ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZmZm Z ddl!m"Z"m#Z# ddl$m%Z% ddl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ ddl0m1Z1 ddl2m3Z3 ee4d�� Z5 G d� de� Z6 G d� de� Z7 G d� de� Z8 G d� d� Z9 G d� d ee9� Z: G d!� d"ee9� Z; G d#� d$ee9� Z< G d%� d&ee9� Z= G d'� d(e1� Z> G d)� d*e1� Z? G d+� d,e'� Z@ G d-� d.e'� ZA G d/� d0e'� ZB G d1� d2� ZC ee"� G d3� d4e3� � ZD G d5� d6e� ZEy)7z#
Tests for L{twisted.web.template}
� N)�StringIO)�List�Optional)�implementer)�verifyObject)�Deferred�succeed)�EventLoggingObserver)�globalLogPublisher)�Failure)�FilePath)�TestCase)�suppress)�UnexposedMethodError)�FlattenerError�MissingRenderMethod�MissingTemplateLoader)�IRequest�ITemplateLoader)�NOT_DONE_YET) �Element�Flattenable�Tag� TagLoader�XMLFile� XMLString�
renderElement�renderer�tags)�FlattenTestCase)�DummyRequest�hPassing filenames or file objects to XMLFile is deprecated since Twisted 12.1. Pass a FilePath instead.)�category�messagec �8 � e Zd ZdZdd�Zdd�Zdd�Zdd�Zdd�Zy) �TagFactoryTestszO
Tests for L{_TagFactory} through the publicly-exposed L{tags} object.
Nc �\ � t j }| j |j d� y)z=
HTML tags can be retrieved through C{tags}.
�aN)r r( �assertEqual�tagName��self�tags �@/usr/lib/python3/dist-packages/twisted/web/test/test_template.py�test_lookupTagzTagFactoryTests.test_lookupTag4 s! � � �f�f��������c�*� c �\ � t j }| j |j d� y)zj
Twisted supports the latest and greatest HTML tags from the HTML5
specification.
�videoN)r r2 r) r* r+ s r. �test_lookupHTML5Tagz#TagFactoryTests.test_lookupHTML5Tag; s! � �
�j�j��������g�.r0 c �\ � t j }| j |j d� y)z�
To support transparent inclusion in templates, there is a special tag,
the transparent tag, which has no name of its own but is accessed
through the "transparent" attribute.
� N)r �transparentr) r* r+ s r. �test_lookupTransparentTagz)TagFactoryTests.test_lookupTransparentTagC s# � � ����������b�)r0 c �D � | j t t t d� y)zv
Invalid tags which are not part of HTML cause AttributeErrors when
accessed through C{tags}.
�invalidN��assertRaises�AttributeError�getattrr �r, s r. �test_lookupInvalidTagz%TagFactoryTests.test_lookupInvalidTagL s � �
���.�'�4��Cr0 c �D � | j t t t d� y)z�
As a special case, the <xmp> tag is simply not available through
C{tags} or any other part of the templating machinery.
�xmpNr: r>