File: //lib/python3/dist-packages/twisted/positioning/test/__pycache__/test_sentence.cpython-310.pyc
o
�bZ � @ s� d Z ddlZddlmZ ddlmZ dZdZG dd� d�ZG d d
� d
ej �Z
G dd� dej�ZG d
d� dej �Z
G dd� d�ZG dd� dee�ZdS )z"
Tests for positioning sentences.
� N)� _sentence)�TestCase�someStringValue�someOtherStringValuec @ s e Zd ZdZedd� �ZdS )�
DummyProtocolz"
A simple, fake protocol.
c C s
dt tgS )N�type)�sentinelValueOne�sentinelValueTwo� r
r
�H/usr/lib/python3/dist-packages/twisted/positioning/test/test_sentence.py�getSentenceAttributes s
z#DummyProtocol.getSentenceAttributesN)�__name__�
__module__�__qualname__�__doc__�staticmethodr r
r
r
r r s r c @ � e Zd ZdZe�� ZdS )�
DummySentencez*
A sentence for L{DummyProtocol}.
N)r
r r r r r �ALLOWED_ATTRIBUTESr
r
r
r r � r c @ s e Zd ZdZdeedgiZdS )�
MixinProtocolz�
A simple, fake protocol that declaratively tells you the sentences
it produces using L{base.PositioningSentenceProducerMixin}.
N)r
r r r r r �_SENTENCE_CONTENTSr
r
r
r r # s ��r c @ r )�
MixinSentencez*
A sentence for L{MixinProtocol}.
N)r
r r r r r r r
r
r
r r 2 r r c @ sJ e Zd ZdZdd� Zdd� Zdd� ZdZd Zddd
�Z dd� Z
dd� ZdS )�SentenceTestsMixinzI
Tests for positioning protocols and their respective sentences.
c C s: t � }| �t|i�}| �t|t�|� | �t|t�� dS )z�
A sentence attribute gets the correct value, and accessing an
unset attribute (which is specified as being a valid sentence
attribute) gets L{None}.
N)�object�
sentenceClassr �assertEqual�getattr�assertIsNoner )�self�thisSentinel�sentencer
r
r �test_attributeAccess? s z'SentenceTestsMixin.test_attributeAccessc C s | � i �}| �tt|d� dS )zM
Accessing a nonexistent attribute raises C{AttributeError}.
�BOGUSN�r �assertRaises�AttributeErrorr �r r! r
r
r �"test_raiseOnMissingAttributeAccessJ s
z5SentenceTestsMixin.test_raiseOnMissingAttributeAccessc C s"