AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/twisted/positioning/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/twisted/positioning/test/__pycache__/test_sentence.cpython-310.pyc
o

�bZ�@s�dZddlZddlmZddlmZdZdZGdd�d�ZGd	d
�d
ej	�Z
Gdd�dej�ZGd
d�dej	�Z
Gdd�d�ZGdd�dee�ZdS)z"
Tests for positioning sentences.
�N)�	_sentence)�TestCase�someStringValue�someOtherStringValuec@seZdZdZedd��ZdS)�
DummyProtocolz"
    A simple, fake protocol.
    cCs
dttgS)N�type)�sentinelValueOne�sentinelValueTwo�r
r
�H/usr/lib/python3/dist-packages/twisted/positioning/test/test_sentence.py�getSentenceAttributess
z#DummyProtocol.getSentenceAttributesN)�__name__�
__module__�__qualname__�__doc__�staticmethodrr
r
r
rrsrc@�eZdZdZe��ZdS)�
DummySentencez*
    A sentence for L{DummyProtocol}.
    N)r
rrrrr�ALLOWED_ATTRIBUTESr
r
r
rr�rc@seZdZdZdeedgiZdS)�
MixinProtocolz�
    A simple, fake protocol that declaratively tells you the sentences
    it produces using L{base.PositioningSentenceProducerMixin}.
    N)r
rrrrr	�_SENTENCE_CONTENTSr
r
r
rr#s��rc@r)�
MixinSentencez*
    A sentence for L{MixinProtocol}.
    N)r
rrrrrrr
r
r
rr2rrc@sJeZdZdZdd�Zdd�Zdd�ZdZd	Zddd
�Z	dd�Z
dd�ZdS)�SentenceTestsMixinzI
    Tests for positioning protocols and their respective sentences.
    cCs: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?sz'SentenceTestsMixin.test_attributeAccesscCs|�i�}|�tt|d�dS)zM
        Accessing a nonexistent attribute raises C{AttributeError}.
        �BOGUSN�r�assertRaises�AttributeErrorr�rr!r
r
r�"test_raiseOnMissingAttributeAccessJs
z5SentenceTestsMixin.test_raiseOnMissingAttributeAccesscCs"|�ddi�}|�tt|d�dS)z�
        Accessing bogus attributes raises C{AttributeError}, *even*
        when that attribute actually is in the sentence data.
        r#Nr$r'r
r
r�test_raiseOnBadAttributeAccessQsz1SentenceTestsMixin.test_raiseOnBadAttributeAccess�tummiesz<%s (%s) {%s}>�unknown type�cCs|jj}|j|||fS)aQ
        Builds the expected repr for a sentence.

        @param sentenceType: The name of the sentence type (e.g "GPGGA").
        @type sentenceType: C{str}
        @param dataRepr: The repr of the data in the sentence.
        @type dataRepr: C{str}
        @return: The expected repr of the sentence.
        @rtype: C{str}
        )rr
�reprTemplate)r�sentenceType�dataRepr�clsNamer
r
r�
_expectedRepr\sz SentenceTestsMixin._expectedReprcCs&|�i�}|��}|�t|�|�dS)zE
        Test the repr of an empty sentence of unknown type.
        N)rr1r�repr�rr!�expectedReprr
r
r�test_unknownTypeReprjs
z'SentenceTestsMixin.test_unknownTypeReprcCs0|�d|ji�}|�|j�}|�t|�|�dS)zC
        Test the repr of an empty sentence of known type.
        rN)rr.r1rr2r3r
r
r�test_knownTypeReprrsz%SentenceTestsMixin.test_knownTypeReprN)r+r,)r
rrrr"r(r)r.r-r1r5r6r
r
r
rr:s
rc@s eZdZdZdd�Zdd�ZdS)�
MixinTestszm
    Tests for protocols deriving from L{base.PositioningSentenceProducerMixin}
    and their sentences.
    cCst�|_t|_dS)N)r�protocolrr)rr
r
r�setUp�s
zMixinTests.setUpcCs<|j��}|�d|�|jj}tj|���}|�d|�dS)a�
        L{None} does not appear in the sentence attributes of the
        protocol, even though it's in the specification.

        This is because L{None} is a placeholder for parts of the sentence you
        don't really need or want, but there are some bits later on in the
        sentence that you do want. The alternative would be to have to specify
        things like "_UNUSED0", "_UNUSED1"... which would end up cluttering
        the sentence data and eventually adapter state.
        N)r8r�assertNotInr�	itertools�chain�values�assertIn)r�sentenceAttributes�sentenceContents�sentenceSpecAttributesr
r
r�test_noNoneInSentenceAttributes�s

z*MixinTests.test_noNoneInSentenceAttributesN)r
rrrr9rBr
r
r
rr7{sr7)rr;�twisted.positioningr�twisted.trial.unittestrrr	r�
_BaseSentencer�!_PositioningSentenceProducerMixinrrrr7r
r
r
r�<module>s
A

Anon7 - 2022
AnonSec Team