File: //lib/python3/dist-packages/genshi/template/tests/__pycache__/directives.cpython-310.pyc
o
!�b(� � @ s d dl Z d dlZd dlZd dlZd dlmZ d dlmZmZm Z m
Z
mZ G dd� dej�Z
G dd� dej�ZG dd � d ej�ZG d
d� dej�ZG dd
� d
ej�ZG dd� dej�ZG dd� dej�ZG dd� dej�ZG dd� dej�ZG dd� dej�Zdd� Zedkr�ejdd� dS dS )� N)�
IS_PYTHON2)�
directives�MarkupTemplate�TextTemplate�TemplateRuntimeError�TemplateSyntaxErrorc @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �AttrsDirectiveTestCasez,Tests for the `py:attrs` template directive.c C s8 t d�}ddiddig}| �d|j|d�jdd�� dS ) zM
Verify that the directive has access to the loop variables.
zt<doc xmlns:py="http://genshi.edgewall.org/">
<elem py:for="item in items" py:attrs="item"/>
</doc>�id� � z;<doc>
<elem id="1"/><elem id="2"/>
</doc>��itemsN��encoding�r �assertEqual�generate�render)�self�tmplr
� r �B/usr/lib/python3/dist-packages/genshi/template/tests/directives.py�test_combined_with_loop s
�z.AttrsDirectiveTestCase.test_combined_with_loopc C �$ t d�}| �d|�� jdd�� dS )�}
Verify that an attribute value that evaluates to `None` removes an
existing attribute of that name.
zu<doc xmlns:py="http://genshi.edgewall.org/">
<elem class="foo" py:attrs="{'class': 'bar'}"/>
</doc>z2<doc>
<elem class="bar"/>
</doc>Nr r �r r r r r �test_update_existing_attr'