§
    Ètºf\t  ã                  ó~  — d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	 ddl
mZ ddlmZ  G d„ d	e¦  «        Z G d
„ de¦  «        Z G d„ de¦  «        Zd#d„Zd#d„Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d „ d!e¦  «        Zd"S )$z(
Test cases for positioning primitives.
é    )Úannotations)Úverify)Úbase)ÚAnglesÚ
Directions)ÚIPositioningBeacon)ÚTestCasec                  ó2   — e Zd ZdZd	d„Zd	d„Zd	d„Zd	d„ZdS )
Ú
AngleTestsz@
    Tests for the L{twisted.positioning.base.Angle} class.
    ÚreturnÚNonec                ór   — t          j        ¦   «         }|                      dt          |¦  «        ¦  «         dS )zd
        The repr of an empty angle says that is of unknown type and unknown
        value.
        z'<Angle of unknown type (unknown value)>N©r   ÚAngleÚassertEqualÚrepr©ÚselfÚas     úa/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/positioning/test/test_base.pyÚ
test_emptyzAngleTests.test_empty   s2   € õ
 ŒJ‰LŒLˆØ×ÒÐBÅDÈÁGÄGÑLÔLÐLÐLÐLó    c                óŠ   — t          j        t          j        ¬¦  «        }|                      dt          |¦  «        ¦  «         dS )zf
        The repr of an empty variation says that it is a variation of unknown
        value.
        ©Ú	angleTypez<Variation (unknown value)>N)r   r   r   Ú	VARIATIONr   r   r   s     r   Útest_variationzAngleTests.test_variation   s<   € õ
 ŒJ¥Ô!1Ð2Ñ2Ô2ˆØ×ÒÐ6½¸Q¹¼Ñ@Ô@Ð@Ð@Ð@r   c                ót   — t          j        d¦  «        }|                      dt          |¦  «        ¦  «         dS )zz
        The repr of an angle of unknown type but a given value displays that
        type and value in its repr.
        ç      ð?z%<Angle of unknown type (1.0 degrees)>Nr   r   s     r   Útest_unknownTypezAngleTests.test_unknownType%   s4   € õ
 ŒJ�s‰OŒOˆØ×ÒÐ@Å$ÀqÁ'Ä'ÑJÔJÐJÐJÐJr   c                óT   — |                       t          t          j        d¬¦  «         dS )zS
        Trying to create an angle with a bogus type raises C{ValueError}.
        ÚBOGUSr   N)ÚassertRaisesÚ
ValueErrorr   r   ©r   s    r   Útest_bogusTypezAngleTests.test_bogusType-   s'   € ð 	×Ò�*¥d¤j¸GÐÑDÔDÐDÐDÐDr   N©r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r    r&   © r   r   r   r      s€   € € € € € ðð ðMð Mð Mð MðAð Að Að AðKð Kð Kð KðEð Eð Eð Eð Eð Er   r   c                  óÂ   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd„Zdd	„Z	dd
„Z
dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„ZdS )ÚHeadingTestszB
    Tests for the L{twisted.positioning.base.Heading} class.
    r   r   c                ó  — t          j        d¦  «        }|                      |j        d¦  «         |                      t	          |¦  «        d¦  «         |                      |j        ¦  «         |                      |j        ¦  «         dS )zÕ
        Tests that a simple heading has a value in decimal degrees, which is
        also its value when converted to a float. Its variation, and by
        consequence its corrected heading, is L{None}.
        r   N)r   ÚHeadingr   ÚinDecimalDegreesÚfloatÚassertIsNoneÚ	variationÚcorrectedHeading©r   Úhs     r   Útest_simplezHeadingTests.test_simple9   s{   € õ ŒL˜ÑÔˆØ×Ò˜Ô+¨SÑ1Ô1Ð1Ø×Ò�˜q™œ 3Ñ'Ô'Ð'Ø×Ò˜!œ+Ñ&Ô&Ð&Ø×Ò˜!Ô,Ñ-Ô-Ð-Ð-Ð-r   c                óx   — t          j        d¦  «        }d}|                      t          |¦  «        |¦  «         dS )zt
        A repr of a heading with no variation reports its value and that the
        variation is unknown.
        r   z*<Heading (1.0 degrees, unknown variation)>N)r   r0   r   r   )r   ÚheadingÚexpectedReprs      r   Ú test_headingWithoutVariationReprz-HeadingTests.test_headingWithoutVariationReprE   s:   € õ
 ”,˜sÑ#Ô#ˆØCˆØ×Ò�˜g™œ¨Ñ5Ô5Ð5Ð5Ð5r   c                óÄ   — d\  }}t           j                             ||¬¦  «        }d}|                      t	          |¦  «        |                     ||¦  «        ¦  «         dS )zu
        A repr of a heading with known variation reports its value and the
        value of that variation.
        )r   ç      $À©ÚvariationValuez2<Heading ({0} degrees, <Variation ({1} degrees)>)>N)r   r0   Ú
fromFloatsr   r   Úformat)r   Úangler4   r:   ÚreprTemplates        r   Útest_headingWithVariationReprz*HeadingTests.test_headingWithVariationReprN   s_   € ð
 &ÑˆˆyÝ”,×)Ò)¨%À	Ð)ÑJÔJˆØKˆØ×Ò�˜g™œ¨×(;Ò(;¸EÀ9Ñ(MÔ(MÑNÔNÐNÐNÐNr   c                óz   — |                       t          j        d¦  «        t          j        d¦  «        ¦  «         dS )z>
        Headings with the same values compare equal.
        r   N)r   r   r0   r%   s    r   Útest_valueEqualityzHeadingTests.test_valueEqualityX   s4   € ð 	×Ò�œ cÑ*Ô*­D¬L¸Ñ,=Ô,=Ñ>Ô>Ð>Ð>Ð>r   c                óz   — |                       t          j        d¦  «        t          j        d¦  «        ¦  «         dS )zA
        Headings with different values compare unequal.
        r   ç       @N)ÚassertNotEqualr   r0   r%   s    r   Útest_valueInequalityz!HeadingTests.test_valueInequality^   s4   € ð 	×Ò�DœL¨Ñ-Ô-­t¬|¸CÑ/@Ô/@ÑAÔAÐAÐAÐAr   c                ó.   — t          j        d¦  «         dS )zR
        Headings can be instantiated with a value of 0 and no variation.
        r   N©r   r0   r%   s    r   Útest_zeroHeadingEdgeCasez%HeadingTests.test_zeroHeadingEdgeCased   s   € õ 	Œ�Q‰Œˆˆˆr   c                ó0   — t          j        dd¦  «         dS )zh
        Headings can be instantiated with a value of 0 and a variation of 180
        degrees.
        r   é´   NrM   r%   s    r   Ú*test_zeroHeading180DegreeVariationEdgeCasez7HeadingTests.test_zeroHeading180DegreeVariationEdgeCasej   s   € õ
 	Œ�Q˜ÑÔÐÐÐr   Úkwr2   c                óL   —  | j         t          t          j        j        fi |¤Ž dS )z¤
        Helper function for verifying that bad values raise C{ValueError}.

        @param kw: The keyword arguments passed to L{base.Heading.fromFloats}.
        N)r#   r$   r   r0   rA   )r   rR   s     r   Ú_badValueTestzHeadingTests._badValueTestq   s,   € ð 	ˆÔ�*¥d¤lÔ&=ÐDÐDÀÐDÐDÐDÐDÐDr   c                ó2   — |                       d¬¦  «         dS )zO
        Headings can not be instantiated with a value of 360 degrees.
        g     €v@©Ú
angleValueN©rT   r%   s    r   Útest_badAngleValueEdgeCasez'HeadingTests.test_badAngleValueEdgeCasey   ó!   € ð 	×Ò eÐÑ,Ô,Ð,Ð,Ð,r   c                ó2   — |                       d¬¦  «         dS )zT
        Headings can not be instantiated with a variation of -180 degrees.
        ç     €fÀr?   NrX   r%   s    r   Útest_badVariationEdgeCasez&HeadingTests.test_badVariationEdgeCase   ó!   € ð 	×Ò¨&ÐÑ1Ô1Ð1Ð1Ð1r   c                ó2   — |                       d¬¦  «         dS )z>
        Negative heading values raise C{ValueError}.
        r>   rV   NrX   r%   s    r   Útest_negativeHeadingz!HeadingTests.test_negativeHeading…   rZ   r   c                ó2   — |                       d¬¦  «         dS )zK
        Heading values greater than C{360.0} raise C{ValueError}.
        g      w@rV   NrX   r%   s    r   Útest_headingTooLargez!HeadingTests.test_headingTooLarge‹   rZ   r   c                ó2   — |                       d¬¦  «         dS )zK
        Variation values less than C{-180.0} raise C{ValueError}.
        g     ÀgÀr?   NrX   r%   s    r   Útest_variationTooNegativez&HeadingTests.test_variationTooNegative‘   r^   r   c                ó2   — |                       d¬¦  «         dS )zM
        Variation values greater than C{180.0} raise C{ValueError}.
        g     Àg@r?   NrX   r%   s    r   Útest_variationTooPositivez&HeadingTests.test_variationTooPositive—   s!   € ð 	×Ò¨%ÐÑ0Ô0Ð0Ð0Ð0r   c                ó¸   — t           j                             dd¬¦  «        }|                      |j        t          j        dt          j        ¦  «        ¦  «         dS )zQ
        A heading with a value and a variation has a corrected heading.
        r   r>   r?   g      &@N©r   r0   rA   r   r5   r   r   ÚHEADINGr6   s     r   Útest_correctedHeadingz"HeadingTests.test_correctedHeading�   sK   € õ ŒL×#Ò# C¸Ð#Ñ>Ô>ˆØ×Ò˜Ô+­T¬Z¸½f¼nÑ-MÔ-MÑNÔNÐNÐNÐNr   c                ó¸   — t           j                             dd¬¦  «        }|                      |j        t          j        dt          j        ¦  «        ¦  «         dS )zµ
        A heading with a value and a variation has the appropriate corrected
        heading value, even when the variation puts it across the 360 degree
        boundary.
        ç     pv@g       Àr?   r   Nrh   r6   s     r   Útest_correctedHeadingOverflowz*HeadingTests.test_correctedHeadingOverflow¤   óK   € õ ŒL×#Ò# E¸$Ð#Ñ?Ô?ˆØ×Ò˜Ô+­T¬Z¸½V¼^Ñ-LÔ-LÑMÔMÐMÐMÐMr   c                ó¸   — t           j                             dd¬¦  «        }|                      |j        t          j        dt          j        ¦  «        ¦  «         dS )z¹
        A heading with a value and a variation has the appropriate corrected
        heading value, even when the variation puts it exactly at the 360
        degree boundary.
        rl   ç      ð¿r?   ç        Nrh   r6   s     r   Ú%test_correctedHeadingOverflowEdgeCasez2HeadingTests.test_correctedHeadingOverflowEdgeCase­   rn   r   c                ó¸   — t           j                             dd¬¦  «        }|                      |j        t          j        dt          j        ¦  «        ¦  «         dS )z²
        A heading with a value and a variation has the appropriate corrected
        heading value, even when the variation puts it under the 0 degree
        boundary.
        r   rI   r?   rl   Nrh   r6   s     r   Útest_correctedHeadingUnderflowz+HeadingTests.test_correctedHeadingUnderflow¶   sK   € õ ŒL×#Ò# C¸Ð#Ñ<Ô<ˆØ×Ò˜Ô+­T¬Z¸½v¼~Ñ-NÔ-NÑOÔOÐOÐOÐOr   c                ó¸   — t           j                             dd¬¦  «        }|                      |j        t          j        dt          j        ¦  «        ¦  «         dS )z·
        A heading with a value and a variation has the appropriate corrected
        heading value, even when the variation puts it exactly at the 0
        degree boundary.
        r   r?   rq   Nrh   r6   s     r   Ú&test_correctedHeadingUnderflowEdgeCasez3HeadingTests.test_correctedHeadingUnderflowEdgeCase¿   sK   € õ ŒL×#Ò# C¸Ð#Ñ<Ô<ˆØ×Ò˜Ô+­T¬Z¸½V¼^Ñ-LÔ-LÑMÔMÐMÐMÐMr   c                ó  — t           j                             dd¬¦  «        }|                     d¦  «         |                      |j        j        d¦  «         |                     d¦  «         |                      |j        j        d¦  «         dS )zK
        Setting the sign of a heading changes the variation sign.
        r   r?   é   éÿÿÿÿrp   N)r   r0   rA   ÚsetSignr   r4   r1   r6   s     r   Útest_setVariationSignz"HeadingTests.test_setVariationSignÈ   sx   € õ ŒL×#Ò# C¸Ð#Ñ<Ô<ˆØ	�	Š	�!‰ŒˆØ×Ò˜œÔ5°sÑ;Ô;Ð;Ø	�	Š	�"‰ŒˆØ×Ò˜œÔ5°tÑ<Ô<Ð<Ð<Ð<r   c                óÎ  — t           j                             dd¬¦  «        }|                      t          |j        d¦  «         |                      |j        j        d¦  «         |                      t          |j        d¦  «         |                      |j        j        d¦  «         |                      t          |j        d¦  «         |                      |j        j        d¦  «         dS )z‘
        Setting the sign of a heading to values that aren't C{-1} or C{1}
        raises C{ValueError} and does not affect the heading.
        r   r?   éÎÿÿÿr   é2   N)	r   r0   rA   r#   r$   rz   r   r4   r1   r6   s     r   Útest_setBadVariationSignz%HeadingTests.test_setBadVariationSignÒ   sÃ   € õ
 ŒL×#Ò# C¸Ð#Ñ<Ô<ˆØ×Ò�* a¤i°Ñ5Ô5Ð5Ø×Ò˜œÔ5°sÑ;Ô;Ð;à×Ò�* a¤i°Ñ3Ô3Ð3Ø×Ò˜œÔ5°sÑ;Ô;Ð;à×Ò�* a¤i°Ñ4Ô4Ð4Ø×Ò˜œÔ5°sÑ;Ô;Ð;Ð;Ð;r   c                óÄ   — t           j                             d¦  «        }|                      |j        j        ¦  «         |                      t          |j        d¦  «         dS )zd
        Setting the sign on a heading with unknown variation raises
        C{ValueError}.
        r   rx   N)	r   r0   rA   r3   r4   r1   r#   r$   rz   r6   s     r   Útest_setUnknownVariationSignz)HeadingTests.test_setUnknownVariationSigná   sR   € õ
 ŒL×#Ò# CÑ(Ô(ˆØ×Ò˜!œ+Ô6Ñ7Ô7Ð7Ø×Ò�* a¤i°Ñ3Ô3Ð3Ð3Ð3r   Nr'   )rR   r2   r   r   )r(   r)   r*   r+   r8   r<   rE   rG   rK   rN   rQ   rT   rY   r]   r`   rb   rd   rf   rj   rm   rr   rt   rv   r{   r   r�   r,   r   r   r.   r.   4   sö  € € € € € ðð ð
.ð 
.ð 
.ð 
.ð6ð 6ð 6ð 6ðOð Oð Oð Oð?ð ?ð ?ð ?ðBð Bð Bð Bðð ð ð ðð ð ð ðEð Eð Eð Eð-ð -ð -ð -ð2ð 2ð 2ð 2ð-ð -ð -ð -ð-ð -ð -ð -ð2ð 2ð 2ð 2ð1ð 1ð 1ð 1ðOð Oð Oð OðNð Nð Nð NðNð Nð Nð NðPð Pð Pð PðNð Nð Nð Nð=ð =ð =ð =ð<ð <ð <ð <ð4ð 4ð 4ð 4ð 4ð 4r   r.   c                  óÎ   — e Zd Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd	„Z	dd
„Z
dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„ZdS )ÚCoordinateTestsr   r   c                ót   — t          j        d¦  «        }|                      t          |¦  «        d¦  «         dS )z9
        Coordinates can be converted to floats.
        ç      $@N)r   Ú
Coordinater   r2   ©r   Ú
coordinates     r   Ú
test_floatzCoordinateTests.test_floatì   s7   € õ ”_ TÑ*Ô*ˆ
Ø×Ò�˜zÑ*Ô*¨DÑ1Ô1Ð1Ð1Ð1r   c                ó€   — t          j        d¦  «        }dd› d�}|                      t          |¦  «        |¦  «         dS )zn
        Coordinates that aren't explicitly latitudes or longitudes have an
        appropriate repr.
        r…   z<Angle of unknown type (ú
 degrees)>N)r   r†   r   r   ©r   rˆ   r;   s      r   Ú	test_reprzCoordinateTests.test_repró   sG   € õ
 ”_ TÑ*Ô*ˆ
ØB°$ÐBÐBÐBˆØ×Ò�˜jÑ)Ô)¨<Ñ8Ô8Ð8Ð8Ð8r   c                ó–   — t          j        dt          j        ¦  «        }dd› d�}|                      t          |¦  «        |¦  «         dS )zU
        Positive latitudes have a repr that specifies their type and value.
        r…   ú<Latitude (r‹   N©r   r†   r   ÚLATITUDEr   r   rŒ   s      r   Útest_positiveLatitudez%CoordinateTests.test_positiveLatitudeü   sK   € õ ”_ T­6¬?Ñ;Ô;ˆ
Ø5 TÐ5Ð5Ð5ˆØ×Ò�˜jÑ)Ô)¨<Ñ8Ô8Ð8Ð8Ð8r   c                ó–   — t          j        dt          j        ¦  «        }dd› d�}|                      t          |¦  «        |¦  «         dS )zU
        Negative latitudes have a repr that specifies their type and value.
        ç      IÀr�   r‹   Nr�   rŒ   s      r   Útest_negativeLatitudez%CoordinateTests.test_negativeLatitude  sK   € õ ”_ U­F¬OÑ<Ô<ˆ
Ø6 UÐ6Ð6Ð6ˆØ×Ò�˜jÑ)Ô)¨<Ñ8Ô8Ð8Ð8Ð8r   c                ó–   — t          j        dt          j        ¦  «        }dd› d�}|                      t          |¦  «        |¦  «         dS )zV
        Positive longitudes have a repr that specifies their type and value.
        ç      I@ú<Longitude (r‹   N©r   r†   r   Ú	LONGITUDEr   r   ©r   Ú	longituder;   s      r   Útest_positiveLongitudez&CoordinateTests.test_positiveLongitude  sJ   € õ ”O D­&Ô*:Ñ;Ô;ˆ	Ø6 dÐ6Ð6Ð6ˆØ×Ò�˜i™œ¨,Ñ7Ô7Ð7Ð7Ð7r   c                ó–   — t          j        dt          j        ¦  «        }dd› d�}|                      t          |¦  «        |¦  «         dS )zV
        Negative longitudes have a repr that specifies their type and value.
        r”   r˜   r‹   Nr™   r›   s      r   Útest_negativeLongitudez&CoordinateTests.test_negativeLongitude  sJ   € õ ”O E­6Ô+;Ñ<Ô<ˆ	Ø7 eÐ7Ð7Ð7ˆØ×Ò�˜i™œ¨,Ñ7Ô7Ð7Ð7Ð7r   c                óT   — |                       t          t          j        dd¦  «         dS )zM
        Creating coordinates with bogus types rasies C{ValueError}.
        ç     Àb@r"   N)r#   r$   r   r†   r%   s    r   Útest_bogusCoordinateTypez(CoordinateTests.test_bogusCoordinateType  s&   € ð 	×Ò�*¥d¤o°u¸gÑFÔFÐFÐFÐFr   c                óh   — |                       t          t          j        dt          j        ¦  «         dS )zm
        Creating coordinates with angle types that aren't coordinates raises
        C{ValueError}.
        r¡   N)r#   r$   r   r†   r   ri   r%   s    r   Útest_angleTypeNotCoordinatez+CoordinateTests.test_angleTypeNotCoordinate"  s(   € ð
 	×Ò�*¥d¤o°u½f¼nÑMÔMÐMÐMÐMr   c                óZ   — dd„}|                        |¦   «          |¦   «         ¦  «         dS )zE
        Coordinates with the same value and type are equal.
        r   úbase.Coordinatec                 ó@   — t          j        dt          j        ¦  «        S )Nr   ©r   r†   r   rš   r,   r   r   ÚmakeCoordinatez5CoordinateTests.test_equality.<locals>.makeCoordinate.  s   € Ý”? 3­Ô(8Ñ9Ô9Ð9r   N)r   r¦   )r   )r   r©   s     r   Útest_equalityzCoordinateTests.test_equality)  sD   € ð
	:ð 	:ð 	:ð 	:ð 	×Ò˜˜Ñ)Ô)¨>¨>Ñ+;Ô+;Ñ<Ô<Ð<Ð<Ð<r   c                ó‚   — t          j        d¦  «        }t          j        d¦  «        }|                      ||¦  «         dS )zA
        Coordinates with different values aren't equal.
        r   rp   N)r   r†   rJ   ©r   Úc1Úc2s      r   Útest_differentAnglesInequalityz.CoordinateTests.test_differentAnglesInequality3  s>   € õ Œ_˜SÑ!Ô!ˆÝŒ_˜TÑ"Ô"ˆØ×Ò˜B Ñ#Ô#Ð#Ð#Ð#r   c                ó®   — t          j        dt          j        ¦  «        }t          j        dt          j        ¦  «        }|                      ||¦  «         dS )zT
        Coordinates with the same values but different types aren't equal.
        r   N)r   r†   r   r‘   rš   rJ   r¬   s      r   Útest_differentTypesInequalityz-CoordinateTests.test_differentTypesInequality;  sG   € õ Œ_˜S¥&¤/Ñ2Ô2ˆÝŒ_˜S¥&Ô"2Ñ3Ô3ˆØ×Ò˜B Ñ#Ô#Ð#Ð#Ð#r   c                ó  — t          j        dt          j        ¦  «        }|                     d¦  «         |                      |j        d¦  «         |                     d¦  «         |                      |j        d¦  «         dS )zh
        Setting the sign on a coordinate sets the sign of the value of the
        coordinate.
        r—   rx   ry   r”   N)r   r†   r   r‘   rz   r   r1   ©r   Úcs     r   Ú	test_signzCoordinateTests.test_signC  sm   € õ
 ŒO˜D¥&¤/Ñ2Ô2ˆØ	�	Š	�!‰ŒˆØ×Ò˜Ô+¨TÑ2Ô2Ð2Ø	�	Š	�"‰ŒˆØ×Ò˜Ô+¨UÑ3Ô3Ð3Ð3Ð3r   c                ó°  — d}t          j        |t          j        ¦  «        }|                      t
          |j        d¦  «         |                      |j        d¦  «         |                      t
          |j        d¦  «         |                      |j        d¦  «         |                      t
          |j        d¦  «         |                      |j        d¦  «         dS )zŠ
        Setting a bogus sign value (not -1 or 1) on a coordinate raises
        C{ValueError} and doesn't affect the coordinate.
        r—   r}   r   r~   N)	r   r†   r   r‘   r#   r$   rz   r   r1   )r   Úvaluer´   s      r   Útest_badVariationSignz%CoordinateTests.test_badVariationSignN  s»   € ð
 ˆÝŒO˜E¥6¤?Ñ3Ô3ˆà×Ò�* a¤i°Ñ5Ô5Ð5Ø×Ò˜Ô+¨TÑ2Ô2Ð2à×Ò�* a¤i°Ñ3Ô3Ð3Ø×Ò˜Ô+¨TÑ2Ô2Ð2à×Ò�* a¤i°Ñ4Ô4Ð4Ø×Ò˜Ô+¨TÑ2Ô2Ð2Ð2Ð2r   c                óŽ   — t          j        dt          j        ¦  «        }|                      |j        t          j        ¦  «         dS )zD
        Positive latitudes are in the northern hemisphere.
        r   N)r   r†   r   r‘   r   Ú
hemispherer   ÚNORTHr‡   s     r   Útest_northernHemispherez'CoordinateTests.test_northernHemisphere_  s9   € õ ”_ S­&¬/Ñ:Ô:ˆ
Ø×Ò˜Ô.µ
Ô0@ÑAÔAÐAÐAÐAr   c                óŽ   — t          j        dt          j        ¦  «        }|                      |j        t          j        ¦  «         dS )zD
        Positive longitudes are in the eastern hemisphere.
        r   N)r   r†   r   rš   r   rº   r   ÚEASTr‡   s     r   Útest_easternHemispherez&CoordinateTests.test_easternHemispheref  s9   € õ ”_ S­&Ô*:Ñ;Ô;ˆ
Ø×Ò˜Ô.µ
´Ñ@Ô@Ð@Ð@Ð@r   c                óŽ   — t          j        dt          j        ¦  «        }|                      |j        t          j        ¦  «         dS )zD
        Negative latitudes are in the southern hemisphere.
        rp   N)r   r†   r   r‘   r   rº   r   ÚSOUTHr‡   s     r   Útest_southernHemispherez'CoordinateTests.test_southernHemispherem  s9   € õ ”_ T­6¬?Ñ;Ô;ˆ
Ø×Ò˜Ô.µ
Ô0@ÑAÔAÐAÐAÐAr   c                óŽ   — t          j        dt          j        ¦  «        }|                      |j        t          j        ¦  «         dS )zD
        Negative longitudes are in the western hemisphere.
        rp   N)r   r†   r   rš   r   rº   r   ÚWESTr‡   s     r   Útest_westernHemispherez&CoordinateTests.test_westernHemispheret  s9   € õ ”_ T­6Ô+;Ñ<Ô<ˆ
Ø×Ò˜Ô.µ
´Ñ@Ô@Ð@Ð@Ð@r   c                ón   ‡— t          j        dd¦  «        Š|                      t          ˆfd„¦  «         dS )zo
        Accessing the hemisphere for a coordinate that can't compute it
        raises C{ValueError}.
        r   Nc                 ó   •— ‰ j         S )N)rº   )rˆ   s   €r   ú<lambda>z4CoordinateTests.test_badHemisphere.<locals>.<lambda>�  s
   ø€ ¨jÔ.C€ r   )r   r†   r#   r$   r‡   s    @r   Útest_badHemispherez"CoordinateTests.test_badHemisphere{  s<   ø€ õ
 ”_ S¨$Ñ/Ô/ˆ
Ø×Ò�*Ð&CÐ&CÐ&CÐ&CÑDÔDÐDÐDÐDr   c                óŠ   — |                       t          t          d¦  «         |                       t          t          d¦  «         dS )zt
        Creating a latitude with a value greater than or equal to 90 degrees
        raises C{ValueError}.
        r¡   g     €V@N©r#   r$   Ú_makeLatituder%   s    r   Útest_latitudeTooLargez%CoordinateTests.test_latitudeTooLargeƒ  s:   € ð
 	×Ò�*¥m°UÑ;Ô;Ð;Ø×Ò�*¥m°TÑ:Ô:Ð:Ð:Ð:r   c                óŠ   — |                       t          t          d¦  «         |                       t          t          d¦  «         dS )zr
        Creating a latitude with a value less than or equal to -90 degrees
        raises C{ValueError}.
        g     ÀbÀg     €VÀNrË   r%   s    r   Útest_latitudeTooSmallz%CoordinateTests.test_latitudeTooSmall‹  s:   € ð
 	×Ò�*¥m°VÑ<Ô<Ð<Ø×Ò�*¥m°UÑ;Ô;Ð;Ð;Ð;r   c                óŠ   — |                       t          t          d¦  «         |                       t          t          d¦  «         dS )zv
        Creating a longitude with a value greater than or equal to 180 degrees
        raises C{ValueError}.
        g     @o@g     €f@N©r#   r$   Ú_makeLongituder%   s    r   Útest_longitudeTooLargez&CoordinateTests.test_longitudeTooLarge“  s:   € ð
 	×Ò�*¥n°eÑ<Ô<Ð<Ø×Ò�*¥n°eÑ<Ô<Ð<Ð<Ð<r   c                óŠ   — |                       t          t          d¦  «         |                       t          t          d¦  «         dS )zt
        Creating a longitude with a value less than or equal to -180 degrees
        raises C{ValueError}.
        g     @oÀr\   NrÑ   r%   s    r   Útest_longitudeTooSmallz&CoordinateTests.test_longitudeTooSmall›  s:   € ð
 	×Ò�*¥n°fÑ=Ô=Ð=Ø×Ò�*¥n°fÑ=Ô=Ð=Ð=Ð=r   c                óî   — t          j        dt          j        ¦  «        }|                      |j        d¦  «         t          j        dt          j        ¦  «        }|                      |j        d¦  «         dS )zQ
        Coordinate values can be accessed in degrees, minutes, seconds.
        g     @I@)r~   é   r   g%�•CI@)r~   é   é.   N)r   r†   r   r‘   r   ÚinDegreesMinutesSecondsr³   s     r   Útest_inDegreesMinutesSecondsz,CoordinateTests.test_inDegreesMinutesSeconds£  sb   € õ ŒO˜D¥&¤/Ñ2Ô2ˆØ×Ò˜Ô2°KÑ@Ô@Ð@åŒO˜F¥F¤OÑ4Ô4ˆØ×Ò˜Ô2°LÑAÔAÐAÐAÐAr   c                ód   — t          j        dd¦  «        }|                      |j        ¦  «         dS )zz
        If the vaue of a coordinate is L{None}, its values in degrees,
        minutes, seconds is also L{None}.
        N)r   r†   r3   rÚ   r³   s     r   Ú(test_unknownAngleInDegreesMinutesSecondsz8CoordinateTests.test_unknownAngleInDegreesMinutesSeconds­  s2   € õ
 ŒO˜D $Ñ'Ô'ˆØ×Ò˜!Ô3Ñ4Ô4Ð4Ð4Ð4r   Nr'   )r(   r)   r*   r‰   r�   r’   r•   r�   rŸ   r¢   r¤   rª   r¯   r±   rµ   r¸   r¼   r¿   rÂ   rÅ   rÉ   rÍ   rÏ   rÓ   rÕ   rÛ   rÝ   r,   r   r   rƒ   rƒ   ë   s  € € € € € ð2ð 2ð 2ð 2ð9ð 9ð 9ð 9ð9ð 9ð 9ð 9ð9ð 9ð 9ð 9ð8ð 8ð 8ð 8ð8ð 8ð 8ð 8ðGð Gð Gð GðNð Nð Nð Nð=ð =ð =ð =ð$ð $ð $ð $ð$ð $ð $ð $ð	4ð 	4ð 	4ð 	4ð3ð 3ð 3ð 3ð"Bð Bð Bð BðAð Að Að AðBð Bð Bð BðAð Að Að AðEð Eð Eð Eð;ð ;ð ;ð ;ð<ð <ð <ð <ð=ð =ð =ð =ð>ð >ð >ð >ðBð Bð Bð Bð5ð 5ð 5ð 5ð 5ð 5r   rƒ   r·   r2   r   r¦   c                ó@   — t          j        | t          j        ¦  «        S )z7
    Builds and returns a latitude of given value.
    )r   r†   r   r‘   ©r·   s    r   rÌ   rÌ   ¶  s   € õ Œ?˜5¥&¤/Ñ2Ô2Ð2r   c                ó@   — t          j        | t          j        ¦  «        S )z8
    Builds and returns a longitude of given value.
    r¨   rß   s    r   rÒ   rÒ   ½  s   € õ Œ?˜5¥&Ô"2Ñ3Ô3Ð3r   c                  ó2   — e Zd ZdZd	d„Zd	d„Zd	d„Zd	d„ZdS )
ÚAltitudeTestszC
    Tests for the L{twisted.positioning.base.Altitude} class.
    r   r   c                óú   — t          j        d¦  «        }|                      t          |¦  «        d¦  «         |                      |j        d¦  «         |                      |j        dt           j        z  ¦  «         dS )z�
        Altitudes can be instantiated and reports the correct value in
        meters and feet, as well as when converted to float.
        r   N)r   ÚAltituder   r2   ÚinMetersÚinFeetÚMETERS_PER_FOOT©r   Úaltitudes     r   Ú
test_valuezAltitudeTests.test_valueÉ  sn   € õ
 ”= Ñ%Ô%ˆØ×Ò�˜x™œ¨#Ñ.Ô.Ð.Ø×Ò˜Ô*¨CÑ0Ô0Ð0Ø×Ò˜œ¨#µÔ0DÑ*DÑEÔEÐEÐEÐEr   c                ót   — t          j        d¦  «        }|                      t          |¦  «        d¦  «         dS )zF
        Altitudes report their type and value in their repr.
        r   z<Altitude (1.0 m)>N)r   rä   r   r   rè   s     r   r�   zAltitudeTests.test_reprÓ  s6   € õ ”= Ñ%Ô%ˆØ×Ò�˜h™œÐ)=Ñ>Ô>Ð>Ð>Ð>r   c                ó‚   — t          j        d¦  «        }t          j        d¦  «        }|                      ||¦  «         dS )z<
        Altitudes with equal values compare equal.
        r   N)r   rä   r   ©r   ÚfirstAltitudeÚsecondAltitudes      r   rª   zAltitudeTests.test_equalityÚ  s>   € õ œ cÑ*Ô*ˆÝœ sÑ+Ô+ˆØ×Ò˜¨Ñ7Ô7Ð7Ð7Ð7r   c                ó‚   — t          j        d¦  «        }t          j        d¦  «        }|                      ||¦  «         dS )zF
        Altitudes with different values don't compare equal.
        r   rp   N)r   rä   rJ   rí   s      r   Útest_inequalityzAltitudeTests.test_inequalityâ  s>   € õ œ cÑ*Ô*ˆÝœ tÑ,Ô,ˆØ×Ò˜M¨>Ñ:Ô:Ð:Ð:Ð:r   Nr'   )r(   r)   r*   r+   rê   r�   rª   rñ   r,   r   r   râ   râ   Ä  sr   € € € € € ðð ðFð Fð Fð Fð?ð ?ð ?ð ?ð8ð 8ð 8ð 8ð;ð ;ð ;ð ;ð ;ð ;r   râ   c                  ó:   — e Zd ZdZd
d„Zd
d„Zd
d„Zd
d„Zd
d„Zd	S )Ú
SpeedTestsz@
    Tests for the L{twisted.positioning.base.Speed} class.
    r   r   c                óª   — t          j        d¦  «        }|                      |j        d¦  «         |                      t	          |¦  «        d¦  «         dS )ú‚
        Speeds can be instantiated, and report their value in meters
        per second, and can be converted to floats.
        r—   N)r   ÚSpeedr   ÚinMetersPerSecondr2   ©r   Úspeeds     r   rê   zSpeedTests.test_valueð  óN   € õ
 ”
˜4Ñ Ô ˆØ×Ò˜Ô0°$Ñ7Ô7Ð7Ø×Ò�˜u™œ tÑ,Ô,Ð,Ð,Ð,r   c                ót   — t          j        d¦  «        }|                      t          |¦  «        d¦  «         dS )zC
        Speeds report their type and value in their repr.
        r—   z<Speed (50.0 m/s)>N)r   rö   r   r   rø   s     r   r�   zSpeedTests.test_reprù  ó6   € õ ”
˜4Ñ Ô ˆØ×Ò�˜e™œÐ&:Ñ;Ô;Ð;Ð;Ð;r   c                óR   — |                       t          t          j        d¦  «         dS )zA
        Creating a negative speed raises C{ValueError}.
        rp   N)r#   r$   r   rö   r%   s    r   Útest_negativeSpeedszSpeedTests.test_negativeSpeeds   s$   € ð 	×Ò�*¥d¤j°$Ñ7Ô7Ð7Ð7Ð7r   c                ó~   — t          j        d¦  «        }|                      dt           j        z  |j        ¦  «         dS )zC
        A speed can be converted into its value in knots.
        r   rx   N)r   rö   r   ÚMPS_PER_KNOTÚinKnotsrø   s     r   Útest_inKnotszSpeedTests.test_inKnots  ó7   € õ ”
˜3‘”ˆØ×Ò˜�TÔ.Ñ.°´Ñ>Ô>Ð>Ð>Ð>r   c                óp   — |                       dt          t          j        d¦  «        ¦  «        ¦  «         dS )z;
        A speed can be converted into a C{float}.
        r   N)r   r2   r   rö   r%   s    r   Útest_asFloatzSpeedTests.test_asFloat  ó0   € ð 	×Ò˜�e¥D¤J¨s¡O¤OÑ4Ô4Ñ5Ô5Ð5Ð5Ð5r   Nr'   )	r(   r)   r*   r+   rê   r�   rþ   r  r  r,   r   r   ró   ró   ë  s‚   € € € € € ðð ð-ð -ð -ð -ð<ð <ð <ð <ð8ð 8ð 8ð 8ð?ð ?ð ?ð ?ð6ð 6ð 6ð 6ð 6ð 6r   ró   c                  ó:   — e Zd ZdZd
d„Zd
d„Zd
d„Zd
d„Zd
d„Zd	S )Ú
ClimbTestsz6
    Tests for L{twisted.positioning.base.Climb}.
    r   r   c                óª   — t          j        d¦  «        }|                      |j        d¦  «         |                      t	          |¦  «        d¦  «         dS )rõ   ç      E@N©r   ÚClimbr   r÷   r2   ©r   Úclimbs     r   r8   zClimbTests.test_simple  rú   r   c                ót   — t          j        d¦  «        }|                      t          |¦  «        d¦  «         dS )zC
        Climbs report their type and value in their repr.
        r
  z<Climb (42.0 m/s)>N)r   r  r   r   r  s     r   r�   zClimbTests.test_repr"  rü   r   c                óª   — t          j        d¦  «        }|                      |j        d¦  «         |                      t	          |¦  «        d¦  «         dS )z‰
        Climbs can have negative values, and still report that value
        in meters per second and when converted to floats.
        g      EÀNr  r  s     r   Útest_negativeClimbszClimbTests.test_negativeClimbs)  sN   € õ
 ”
˜5Ñ!Ô!ˆØ×Ò˜Ô0°%Ñ8Ô8Ð8Ø×Ò�˜u™œ uÑ-Ô-Ð-Ð-Ð-r   c                ó~   — t          j        d¦  «        }|                      dt           j        z  |j        ¦  «         dS )zC
        A climb can be converted into its value in knots.
        r   rx   N)r   r  r   r   r  r  s     r   Útest_speedInKnotszClimbTests.test_speedInKnots2  r  r   c                óp   — |                       dt          t          j        d¦  «        ¦  «        ¦  «         dS )z;
        A climb can be converted into a C{float}.
        r   N)r   r2   r   r  r%   s    r   r  zClimbTests.test_asFloat9  r  r   Nr'   )	r(   r)   r*   r+   r8   r�   r  r  r  r,   r   r   r  r    s‚   € € € € € ðð ð-ð -ð -ð -ð<ð <ð <ð <ð.ð .ð .ð .ð?ð ?ð ?ð ?ð6ð 6ð 6ð 6ð 6ð 6r   r  c                  óv   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd„Zdd	„Z	dd
„Z
dd„ZdZdd„Zdd„Zdd„Zdd„ZdS )ÚPositionErrorTestsz>
    Tests for L{twisted.positioning.base.PositionError}.
    r   r   c                óÈ   — t          j        ¦   «         }|                      |j        ¦  «         |                      |j        ¦  «         |                      |j        ¦  «         dS )z~
        In an empty L{base.PositionError} with no invariant testing, all
        dilutions of positions are L{None}.
        N©r   ÚPositionErrorr3   ÚpdopÚhdopÚvdop©r   ÚpositionErrors     r   Útest_allUnsetz PositionErrorTests.test_allUnsetE  s]   € õ
 Ô*Ñ,Ô,ˆØ×Ò˜-Ô,Ñ-Ô-Ð-Ø×Ò˜-Ô,Ñ-Ô-Ð-Ø×Ò˜-Ô,Ñ-Ô-Ð-Ð-Ð-r   c                óÌ   — t          j        d¬¦  «        }|                      |j        ¦  «         |                      |j        ¦  «         |                      |j        ¦  «         dS )z{
        In an empty L{base.PositionError} with invariant testing, all
        dilutions of positions are L{None}.
        T)ÚtestInvariantNr  r  s     r   Útest_allUnsetWithInvariantz-PositionErrorTests.test_allUnsetWithInvariantO  sb   € õ
 Ô*¸Ð>Ñ>Ô>ˆØ×Ò˜-Ô,Ñ-Ô-Ð-Ø×Ò˜-Ô,Ñ-Ô-Ð-Ø×Ò˜-Ô,Ñ-Ô-Ð-Ð-Ð-r   c                óf   — t          j        d¬¦  «        }|                      |j        d¦  «         dS )zN
        L{base.PositionError}s can be instantiated with just a HDOP.
        r   )r  N©r   r  r   r  r  s     r   Útest_withoutInvariantz(PositionErrorTests.test_withoutInvariantY  s6   € õ Ô*°Ð4Ñ4Ô4ˆØ×Ò˜Ô+¨SÑ1Ô1Ð1Ð1Ð1r   c                óh   — t          j        dd¬¦  «        }|                      |j        d¦  «         dS )zv
        Creating a simple L{base.PositionError} with just a HDOP while
        checking the invariant works.
        r   T)r  r!  Nr$  r  s     r   Útest_withInvariantz%PositionErrorTests.test_withInvariant`  s8   € õ
 Ô*°À4ÐHÑHÔHˆØ×Ò˜Ô+¨SÑ1Ô1Ð1Ð1Ð1r   c                óÖ   — t          j        ddd¬¦  «        }|                      |j        d¦  «         |                      |j        d¦  «         |                      |j        d¦  «         dS )zŽ
        Creating a L{base.PositionError} with values set to an impossible
        combination works if the invariant is not checked.
        r   )r  r  r  N)r   r  r   r  r  r  )r   Úerrors     r   Útest_invalidWithoutInvariantz/PositionErrorTests.test_invalidWithoutInvarianth  si   € õ
 Ô"¨°#¸CÐ@Ñ@Ô@ˆØ×Ò˜œ SÑ)Ô)Ð)Ø×Ò˜œ SÑ)Ô)Ð)Ø×Ò˜œ SÑ)Ô)Ð)Ð)Ð)r   c                óZ   — |                       t          t          j        dddd¬¦  «         dS )zž
        Creating a L{base.PositionError} with values set to an impossible
        combination raises C{ValueError} if the invariant is being tested.
        r   T)r  r  r  r!  N)r#   r$   r   r  r%   s    r   Útest_invalidWithInvariantz,PositionErrorTests.test_invalidWithInvariantr  s@   € ð
 	×ÒÝÝÔØØØØð 	ñ 	
ô 	
ð 	
ð 	
ð 	
r   c                óv   — t          j        dd¬¦  «        }d|_        |                      |j        d¦  «         dS )z}
        You can set the PDOP value to value inconsisted with HDOP and VDOP
        when not checking the invariant.
        r   ©r  r  ç      Y@N)r   r  r  r   )r   Úpes     r   Útest_setDOPWithoutInvariantz.PositionErrorTests.test_setDOPWithoutInvariant€  s>   € õ
 Ô S¨sÐ3Ñ3Ô3ˆØˆŒØ×Ò˜œ %Ñ(Ô(Ð(Ð(Ð(r   c                ó¸   — t          j        ddd¬¦  «        }|j        }d
d„}|                      t          ||¦  «         |                      |j        |¦  «         d	S )z”
        Attempting to set the PDOP value to value inconsisted with HDOP and
        VDOP when checking the invariant raises C{ValueError}.
        r   T)r  r  r!  r0  úbase.PositionErrorr   r   c                ó   — d| _         d S )Nr/  )r  )r0  s    r   ÚsetPDOPz<PositionErrorTests.test_setDOPWithInvariant.<locals>.setPDOP‘  s   € ØˆBŒGˆGˆGr   N)r0  r3  r   r   )r   r  r  r#   r$   r   )r   r0  r  r5  s       r   Útest_setDOPWithInvariantz+PositionErrorTests.test_setDOPWithInvariant‰  sn   € õ
 Ô S¨sÀ$ÐGÑGÔGˆØŒwˆð	ð 	ð 	ð 	ð 	×Ò�* g¨rÑ2Ô2Ð2Ø×Ò˜œ $Ñ'Ô'Ð'Ð'Ð'r   z.<PositionError (pdop: %s, hdop: %s, vdop: %s)>r0  r3  r  úfloat | Noner  r  c                ó  — |                       |j        |¦  «         |                       |j        |¦  «         |                       |j        |¦  «         |                       t	          |¦  «        | j        |||fz  ¦  «         dS )aþ  
        Tests the DOP values in a position error, and the repr of that
        position error.

        @param pe: The position error under test.
        @type pe: C{PositionError}
        @param pdop: The expected position dilution of precision.
        @type pdop: C{float} or L{None}
        @param hdop: The expected horizontal dilution of precision.
        @type hdop: C{float} or L{None}
        @param vdop: The expected vertical dilution of precision.
        @type vdop: C{float} or L{None}
        N)r   r  r  r  r   ÚREPR_TEMPLATE)r   r0  r  r  r  s        r   Ú_testDOPzPositionErrorTests._testDOP™  s}   € ð( 	×Ò˜œ $Ñ'Ô'Ð'Ø×Ò˜œ $Ñ'Ô'Ð'Ø×Ò˜œ $Ñ'Ô'Ð'Ø×Ò�˜b™œ 4Ô#5¸¸tÀTÐ8JÑ#JÑKÔKÐKÐKÐKr   c                óˆ   — d\  }}|dz  |dz  z
  dz  }t          j        ||¬¦  «        }|                      ||||¦  «         dS )zF
        The VDOP is correctly determined from PDOP and HDOP.
        ©rI   r   é   ç      à?)r  r  N©r   r  r:  )r   r  r  r  r0  s        r   Útest_positionAndHorizontalSetz0PositionErrorTests.test_positionAndHorizontalSet²  óW   € ð ‰
ˆˆdØ�a‘˜$ ™'Ñ! cÑ)ˆÝÔ T°Ð5Ñ5Ô5ˆØ�Š�b˜$  dÑ+Ô+Ð+Ð+Ð+r   c                óˆ   — d\  }}|dz  |dz  z
  dz  }t          j        ||¬¦  «        }|                      ||||¦  «         dS )zF
        The HDOP is correctly determined from PDOP and VDOP.
        r<  r=  r>  )r  r  Nr?  )r   r  r  r  r0  s        r   Útest_positionAndVerticalSetz.PositionErrorTests.test_positionAndVerticalSet»  rA  r   c                óˆ   — d\  }}|dz  |dz  z   dz  }t          j        ||¬¦  «        }|                      ||||¦  «         dS )zF
        The PDOP is correctly determined from HDOP and VDOP.
        )r   r   r=  r>  r.  Nr?  )r   r  r  r  r0  s        r   Útest_horizontalAndVerticalSetz0PositionErrorTests.test_horizontalAndVerticalSetÄ  rA  r   Nr'   )
r0  r3  r  r7  r  r7  r  r7  r   r   )r(   r)   r*   r+   r  r"  r%  r'  r*  r,  r1  r6  r9  r:  r@  rC  rE  r,   r   r   r  r  @  s  € € € € € ðð ð.ð .ð .ð .ð.ð .ð .ð .ð2ð 2ð 2ð 2ð2ð 2ð 2ð 2ð*ð *ð *ð *ð
ð 
ð 
ð 
ð)ð )ð )ð )ð(ð (ð (ð (ð E€MðLð Lð Lð Lð2,ð ,ð ,ð ,ð,ð ,ð ,ð ,ð,ð ,ð ,ð ,ð ,ð ,r   r  c                  ó6   — e Zd ZdZdd„ZddddœZdd„Zdd	„Zd
S )ÚBeaconInformationTestszB
    Tests for L{twisted.positioning.base.BeaconInformation}.
    r   r   c                óÆ   — t          j        ¦   «         }|                      t          |j        ¦  «        d¦  «         d}|                      t          |¦  «        |¦  «         dS )z»
        For an empty beacon information object, the number of used
        beacons is zero, the number of seen beacons is zero, and the
        repr of the object reflects that.
        r   z><BeaconInformation (used beacons (0): [], unused beacons: [])>N)r   ÚBeaconInformationr   ÚlenÚusedBeaconsr   )r   Úbir;   s      r   Útest_minimalz#BeaconInformationTests.test_minimalÓ  s^   € õ Ô#Ñ%Ô%ˆØ×Ò�˜Rœ^Ñ,Ô,¨aÑ0Ô0Ð0àRð 	ð 	×Ò�˜b™œ <Ñ0Ô0Ð0Ð0Ð0r   rx   r   )ÚazimuthÚ	elevationÚsignalToNoiseRatioc                ó¢  ‡ — dˆ fd„}t          ¦   «         }t          dd¦  «        D ]!}|                      ||¬¦  «        ¦  «         Œ"t          j        |¦  «        }‰                      t          |j        ¦  «        d	¦  «         ‰                      t          |j        ¦  «        d
¦  «         ‰                      t          |¦  «        d¦  «         dS )zw
        Tests a beacon information with a bunch of satellites, none of
        which used in computing a fix.
        rR   r2   r   úbase.Satellitec                 óx   •— t          ‰j        ¦  «        }|                     | ¦  «         t          j        di |¤ŽS )Nr,   )ÚdictÚsatelliteKwargsÚupdater   Ú	Satellite)rR   Úkwargsr   s     €r   Ú_buildSatellitez;BeaconInformationTests.test_simple.<locals>._buildSatelliteè  s;   ø€ Ý˜$Ô.Ñ/Ô/ˆFØ�MŠM˜"ÑÔÐÝ”>Ð+Ð+ FÐ+Ð+Ð+r   rx   é
   )Ú
identifieré	   r   a  <BeaconInformation (used beacons (0): [], unused beacons: [<Satellite (1), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (2), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (3), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (4), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (5), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (6), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (7), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (8), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (9), azimuth: 1, elevation: 1, snr: 1.0>])>N)rR   r2   r   rR  )
ÚsetÚrangeÚaddr   rI  r   rJ  ÚseenBeaconsrK  r   )r   rY  ÚbeaconsÚprnrL  s   `    r   r8   z"BeaconInformationTests.test_simpleâ  så   ø€ ð	,ð 	,ð 	,ð 	,ð 	,ð 	,õ
 ‘%”%ˆÝ˜˜B‘<”<ð 	9ð 	9ˆCØ�KŠK˜˜°3Ð7Ñ7Ô7Ñ8Ô8Ð8Ð8åÔ# GÑ,Ô,ˆà×Ò�˜Rœ^Ñ,Ô,¨aÑ0Ô0Ð0Ø×Ò�˜Rœ^Ñ,Ô,¨aÑ0Ô0Ð0Ø×ÒÝ�‰HŒHðñ	
ô 	
ð 	
ð 	
ð 	
r   c                óÚ  — t          j        ¦   «         }t          dd¦  «        D ]S}t          j        d	d|i| j        ¤Ž}|j                             |¦  «         |dz  r|j                             |¦  «         ŒT|                      t          |j        ¦  «        d¦  «         |                      t          |j        ¦  «        d¦  «         |                      t          |¦  «        d¦  «         dS )
zv
        Tests a beacon information with a bunch of satellites, some of
        them used in computing a fix.
        rx   rZ  r[  r=  r\  é   a  <BeaconInformation (used beacons (5): [<Satellite (1), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (3), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (5), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (7), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (9), azimuth: 1, elevation: 1, snr: 1.0>], unused beacons: [<Satellite (2), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (4), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (6), azimuth: 1, elevation: 1, snr: 1.0>, <Satellite (8), azimuth: 1, elevation: 1, snr: 1.0>])>Nr,   )r   rI  r^  rW  rU  r`  r_  rK  r   rJ  r   )r   rL  rb  Ú	satellites       r   Útest_someSatellitesUsedz.BeaconInformationTests.test_someSatellitesUsed  sð   € õ
 Ô#Ñ%Ô%ˆå˜˜B‘<”<ð 	.ð 	.ˆCÝœÐNÐN°#ÐN¸Ô9MÐNÐNˆIØŒN×Ò˜yÑ)Ô)Ð)Ø�Q‰wð .Ø”×"Ò" 9Ñ-Ô-Ð-øà×Ò�˜Rœ^Ñ,Ô,¨aÑ0Ô0Ð0Ø×Ò�˜Rœ^Ñ,Ô,¨aÑ0Ô0Ð0à×ÒÝ�‰HŒHð
Eñ	
ô 	
ð 	
ð 	
ð 	
r   Nr'   )r(   r)   r*   r+   rM  rU  r8   rf  r,   r   r   rG  rG  Î  sl   € € € € € ðð ð1ð 1ð 1ð 1ð #$°!È3ÐOÐO€Oð!
ð !
ð !
ð !
ðF
ð 
ð 
ð 
ð 
ð 
r   rG  c                  ó"   — e Zd ZdZdd„Zdd„ZdS )ÚPositioningBeaconTestsz.
    Tests for L{base.PositioningBeacon}.
    r   r   c                óÄ   — t          j        t          j        ¦  «        }|                      |¦  «         t          j        t           t          j        d¦  «        ¦  «         dS )zX
        Tests that L{base.PositioningBeacon} implements L{IPositioningBeacon}.
        rx   N)r   ÚimplementedByr   ÚPositioningBeaconÚ
assertTruer   ÚverifyObject)r   Ú
implementss     r   Útest_interfacez%PositioningBeaconTests.test_interface*  sN   € õ (Ô5µdÔ6LÑMÔMˆ
Ø�Š˜
Ñ#Ô#Ð#ÝÔÕ.µÔ0FÀqÑ0IÔ0IÑJÔJÐJÐJÐJr   c                óp   — |                       t          t          j        d¦  «        ¦  «        d¦  «         dS )z9
        Tests the repr of a positioning beacon.
        ÚAz<Beacon (A)>N)r   r   r   rk  r%   s    r   r�   z PositioningBeaconTests.test_repr2  s3   € ð 	×Ò��dÔ4°SÑ9Ô9Ñ:Ô:¸NÑKÔKÐKÐKÐKr   Nr'   )r(   r)   r*   r+   ro  r�   r,   r   r   rh  rh  %  sP   € € € € € ðð ðKð Kð Kð KðLð Lð Lð Lð Lð Lr   rh  c                  ó"   — e Zd ZdZdd„Zdd„ZdS )ÚSatelliteTestsz:
    Tests for L{twisted.positioning.base.Satellite}.
    r   r   c                óF  — t          j        d¦  «        }|                      |j        d¦  «         |                      |j        ¦  «         |                      |j        ¦  «         |                      |j        ¦  «         |                      t          |¦  «        d¦  «         dS )z·
        Tests a minimal satellite that only has a known PRN.

        Tests that the azimuth, elevation and signal to noise ratios
        are L{None} and verifies the repr.
        rx   z:<Satellite (1), azimuth: None, elevation: None, snr: None>N)	r   rW  r   r[  r3   rN  rO  rP  r   ©r   Úss     r   rM  zSatelliteTests.test_minimal>  sœ   € õ ŒN˜1ÑÔˆØ×Ò˜œ qÑ)Ô)Ð)Ø×Ò˜!œ)Ñ$Ô$Ð$Ø×Ò˜!œ+Ñ&Ô&Ð&Ø×Ò˜!Ô.Ñ/Ô/Ð/Ø×ÒÝ�‰GŒGÐTñ	
ô 	
ð 	
ð 	
ð 	
r   c                óT  — t          j        dddd¬¦  «        }|                      |j        d¦  «         |                      |j        d¦  «         |                      |j        d¦  «         |                      |j        d¦  «         |                      t          |¦  «        d¦  «         dS )z·
        Tests a minimal satellite that only has a known PRN.

        Tests that the azimuth, elevation and signal to noise ratios
        are correct and verifies the repr.
        rx   g     àp@g      >@g      9@)r[  rN  rO  rP  z;<Satellite (1), azimuth: 270.0, elevation: 30.0, snr: 25.0>N)r   rW  r   r[  rN  rO  rP  r   ru  s     r   r8   zSatelliteTests.test_simpleN  s´   € õ ŒNØ %°4ÈDð
ñ 
ô 
ˆð 	×Ò˜œ qÑ)Ô)Ð)Ø×Ò˜œ EÑ*Ô*Ð*Ø×Ò˜œ dÑ+Ô+Ð+Ø×Ò˜Ô-¨tÑ4Ô4Ð4Ø×ÒÝ�‰GŒGÐUñ	
ô 	
ð 	
ð 	
ð 	
r   Nr'   )r(   r)   r*   r+   rM  r8   r,   r   r   rs  rs  9  sF   € € € € € ðð ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r   rs  N)r·   r2   r   r¦   )r+   Ú
__future__r   Úzope.interfacer   Útwisted.positioningr   Útwisted.positioning.baser   r   Ú twisted.positioning.ipositioningr   Útwisted.trial.unittestr	   r   r.   rƒ   rÌ   rÒ   râ   ró   r  r  rG  rh  rs  r,   r   r   ú<module>r~     s‘  ððð ð #Ð "Ð "Ð "Ð "Ð "à !Ð !Ð !Ð !Ð !Ð !à $Ð $Ð $Ð $Ð $Ð $Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø ?Ð ?Ð ?Ð ?Ð ?Ð ?Ø +Ð +Ð +Ð +Ð +Ð +ð!Eð !Eð !Eð !Eð !E�ñ !Eô !Eð !EðHt4ð t4ð t4ð t4ð t4�8ñ t4ô t4ð t4ðnH5ð H5ð H5ð H5ð H5�hñ H5ô H5ð H5ðV3ð 3ð 3ð 3ð4ð 4ð 4ð 4ð$;ð $;ð $;ð $;ð $;�Hñ $;ô $;ð $;ðN&6ð &6ð &6ð &6ð &6�ñ &6ô &6ð &6ðR)6ð )6ð )6ð )6ð )6�ñ )6ô )6ð )6ðXK,ð K,ð K,ð K,ð K,˜ñ K,ô K,ð K,ð\T
ð T
ð T
ð T
ð T
˜Xñ T
ô T
ð T
ðnLð Lð Lð Lð L˜Xñ Lô Lð Lð(&
ð &
ð &
ð &
ð &
�Xñ &
ô &
ð &
ð &
ð &
r   