+
    DfjZ                         R t ^ RIt^ RIHt ^ RIHt RtRt ! R R4      t ! R R	]P                  4      t
 ! R
 R]P                  4      t ! R R]P                  4      t ! R R4      t ! R R]]4      tR# )z"
Tests for positioning sentences.
N)	_sentence)TestCasesomeStringValuesomeOtherStringValuec                   4   a  ] tR t^t o Rt]R 4       tRtV tR# )DummyProtocolz
A simple, fake protocol.
c                     R \         \        .# )type)sentinelValueOnesentinelValueTwo     H/usr/lib/python3/dist-packages/twisted/positioning/test/test_sentence.pygetSentenceAttributes#DummyProtocol.getSentenceAttributes   s    (*:;;r   r   N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   __static_attributes____classdictcell____classdict__s   @r   r   r      s      < <r   r   c                   :    ] tR t^tRt]P                  4       tRtR# )DummySentencez"
A sentence for L{DummyProtocol}.
r   N)	r   r   r   r   r   r   r   ALLOWED_ATTRIBUTESr   r   r   r   r   r           '<<>r   r   c                   (    ] tR t^#tRtR]]R./tRtR# )MixinProtocolz
A simple, fake protocol that declaratively tells you the sentences
it produces using L{base.PositioningSentenceProducerMixin}.
Nr   )	r   r   r   r   r   r
   r   _SENTENCE_CONTENTSr   r   r   r   r    r    #   s"     	
r   r    c                   :    ] tR t^2tRt]P                  4       tRtR# )MixinSentencez"
A sentence for L{MixinProtocol}.
r   N)	r   r   r   r   r   r    r   r   r   r   r   r   r#   r#   2   r   r   r#   c                   T   a  ] tR t^:t o RtR tR tR tRtRt	RR lt
R tR	 tR
tV tR# )SentenceTestsMixinzA
Tests for positioning protocols and their respective sentences.
c                    \        4       pV P                  \        V/4      pV P                  \	        V\        4      V4       V P                  \	        V\        4      4       R# )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sentences   &  r   test_attributeAccess'SentenceTestsMixin.test_attributeAccess?   sO     x%%'7&FG+;<lK'(,<=>r   c                `    V P                  / 4      pV P                  \        \        VR4       R# )z=
Accessing a nonexistent attribute raises C{AttributeError}.
BOGUSNr(   assertRaisesAttributeErrorr*   r,   r.   s   & r   "test_raiseOnMissingAttributeAccess5SentenceTestsMixin.test_raiseOnMissingAttributeAccessJ   s(     %%b).'8WEr   c                d    V P                  RR/4      pV P                  \        \        VR4       R# )zs
Accessing bogus attributes raises C{AttributeError}, *even*
when that attribute actually is in the sentence data.
r2   Nr3   r6   s   & r   test_raiseOnBadAttributeAccess1SentenceTestsMixin.test_raiseOnBadAttributeAccessQ   s,    
 %%wo6.'8WEr   tummiesz<%s (%s) {%s}>c                X    V P                   P                  pV P                  W1V3,          # )a  
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}
)r(   r   reprTemplate)r,   sentenceTypedataReprclsNames   &&& r   _expectedRepr SentenceTestsMixin._expectedRepr\   s+     $$--  G8#DDDr   c                ~    V P                  / 4      pV P                  4       pV P                  \        V4      V4       R# )z5
Test the repr of an empty sentence of unknown type.
N)r(   rB   r)   reprr,   r.   expectedReprs   &  r   test_unknownTypeRepr'SentenceTestsMixin.test_unknownTypeReprj   s6     %%b)))+h6r   c                    V P                  RV P                  /4      pV P                  V P                  4      pV P                  \	        V4      V4       R# )z3
Test the repr of an empty sentence of known type.
r	   N)r(   r?   rB   r)   rE   rF   s   &  r   test_knownTypeRepr%SentenceTestsMixin.test_knownTypeReprr   sI     %%vt/@/@&AB))$*;*;<h6r   r   N)zunknown type )r   r   r   r   r   r/   r7   r:   r?   r>   rB   rH   rK   r   r   r   s   @r   r%   r%   :   s<     	?FF L#LE77 7r   r%   c                   0   a  ] tR t^{t o RtR tR tRtV tR# )
MixinTestsza
Tests for protocols deriving from L{base.PositioningSentenceProducerMixin}
and their sentences.
c                :    \        4       V n        \        V n        R # )N)r    protocolr#   r(   )r,   s   &r   setUpMixinTests.setUp   s    %*r   c                    V P                   P                  4       pV P                  RV4       V P                   P                  p\        P
                  ! VP                  4       !  pV P                  RV4       R# )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)rQ   r   assertNotInr!   	itertoolschainvaluesassertIn)r,   sentenceAttributessentenceContentssentenceSpecAttributess   &   r   test_noNoneInSentenceAttributes*MixinTests.test_noNoneInSentenceAttributes   s`     "]]@@B12==;;!*2B2I2I2K!Ld23r   )rQ   r(   N)	r   r   r   r   r   rR   r]   r   r   r   s   @r   rO   rO   {   s     
+4 4r   rO   )r   rV   twisted.positioningr   twisted.trial.unittestr   r
   r   r   _BaseSentencer   !_PositioningSentenceProducerMixinr    r#   r%   rO   r   r   r   <module>rc      s{   
  ) +$ ) < <?I++ ?I?? ?I++ ?>7 >7B4- 4r   