Ë
    ojd¤  ã                   ód  — d Z ddlZddlZddlZddlZddlmZ ddlmZmZ 	 ddl	m
Z
 ddlmZ ddlmZ ddlmZmZmZmZmZmZmZmZmZmZmZmZ dd	lmZ dd
l m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z'  G d„ d«      Z( G d„ de'«      Z) G d„ de'«      Z* G d„ de%e'«      Z+ G d„ de'«      Z,d„ Z-d„ Z. G d„ de'«      Z/ e edddd«      «       G d „ d!«      «       Z0 G d"„ d#«      Z1 e edd$dd«      d%«      d/d&„«       Z2 G d'„ d(e'«      Z3 G d)„ d*e'«      Z4 G d+„ d,e'«      Z5 G d-„ d.e'«      Z6y# e$ r dZ
Y �Œw xY w)0zI
Tests for Twisted's deprecation framework, L{twisted.python.deprecate}.
é    N)Únormcase)Úcatch_warningsÚsimplefilter)Úinvalidate_caches)ÚVersion)Ú	deprecate)ÚDEPRECATION_WARNING_FORMATÚ_appendToDocstringÚ_fullyQualifiedNameÚ_getDeprecationDocstringÚ_getDeprecationWarningStringÚ_mutuallyExclusiveArgumentsÚ_passedArgSpecÚ_passedSignatureÚ
deprecatedÚdeprecatedKeywordParameterÚdeprecatedPropertyÚgetDeprecationWarningString)ÚFilePath)Úplatform)Údeprecatedattributes)ÚTwistedModulesMixin)ÚSynchronousTestCasec                   ó   — e Zd ZdZd„ Zd„ Zy)Ú_MockDeprecatedAttributezq
    Mock of L{twisted.python.deprecate._DeprecatedAttribute}.

    @ivar value: The value of the attribute.
    c                 ó   — || _         y ©N©Úvalue©Úselfr   s     úD/usr/lib/python3/dist-packages/twisted/python/test/test_deprecate.pyÚ__init__z!_MockDeprecatedAttribute.__init__8   s	   € Øˆ�
ó    c                 ó   — | j                   S )z$
        Get a known value.
        r   ©r!   s    r"   Úgetz_MockDeprecatedAttribute.get;   s   € ð �z‰zÐr$   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r#   r'   © r$   r"   r   r   1   s   „ ñòór$   r   c                   ó4   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	y)	ÚModuleProxyTestszÔ
    Tests for L{twisted.python.deprecate._ModuleProxy}, which proxies
    access to module-level attributes, intercepting access to deprecated
    attributes and passing through access to normal attributes.
    c                 ó    — t        j                  d«      }|j                  «       D ]  \  }}t        |||«       Œ t	        j
                  |«      S )zÀ
        Create a temporary module proxy object.

        @param **kw: Attributes to initialise on the temporary module object

        @rtype: L{twistd.python.deprecate._ModuleProxy}
        Úfoo)ÚtypesÚ
ModuleTypeÚitemsÚsetattrr   Ú_ModuleProxy)r!   ÚattrsÚmodÚkeyr   s        r"   Ú
_makeProxyzModuleProxyTests._makeProxyI   sJ   € ô ×Ñ˜uÓ%ˆØŸ+™+›-ò 	%‰JˆC�Ü�C˜˜eÕ$ð	%ä×%Ñ% cÓ*Ð*r$   c                 ó˜   — | j                  d¬«      }| j                  |j                  d«       | j                  t        t
        |d«       y)zÜ
        Getting a normal attribute on a L{twisted.python.deprecate._ModuleProxy}
        retrieves the underlying attribute's value, and raises C{AttributeError}
        if a non-existent attribute is accessed.
        Úhello)ÚSOME_ATTRIBUTEÚDOES_NOT_EXISTN)r9   ÚassertIsr<   ÚassertRaisesÚAttributeErrorÚgetattr©r!   Úproxys     r"   Útest_getattrPassthroughz(ModuleProxyTests.test_getattrPassthroughV   s=   € ð —‘¨w�Ó7ˆØ�‰�e×*Ñ*¨GÔ4Ø×Ñœ.¬'°5Ð:JÕKr$   c                 ó¤   — | j                  «       }t        j                  |d«      }t        d«      |d<   | j	                  |j
                  d«       y)z¸
        Getting an attribute marked as being deprecated on
        L{twisted.python.deprecate._ModuleProxy} results in calling the
        deprecated wrapper's C{get} method.
        Ú_deprecatedAttributesé*   r0   N)r9   ÚobjectÚ__getattribute__r   ÚassertEqualr0   )r!   rC   rF   s      r"   Útest_getattrInterceptz&ModuleProxyTests.test_getattrIntercept`   sH   € ð —‘Ó!ˆÜ &× 7Ñ 7¸Ð?VÓ WÐÜ'?ÀÓ'CÐ˜eÑ$Ø×Ñ˜Ÿ™ BÕ'r$   c                 ó”   — | j                  «       }| j                  t        t        |d«       | j                  t        t        |d«       y)z�
        Private attributes of L{twisted.python.deprecate._ModuleProxy} are
        inaccessible when regular attribute access is used.
        Ú_modulerF   N)r9   r?   r@   rA   rB   s     r"   Útest_privateAttributesz'ModuleProxyTests.test_privateAttributesk   s9   € ð
 —‘Ó!ˆØ×Ñœ.¬'°5¸)ÔDØ×Ñœ.¬'°5Ð:QÕRr$   c                 ó¶   — | j                  «       }d|_        | j                  t        j	                  |d«      d«       | j                  |j                  d«       y)z„
        Setting attributes on L{twisted.python.deprecate._ModuleProxy} proxies
        them through to the wrapped module.
        é   rM   N)r9   rM   ÚassertNotEqualrH   rI   rJ   rB   s     r"   Útest_setattrzModuleProxyTests.test_setattrt   sH   € ð
 —‘Ó!ˆØˆŒØ×ÑœF×3Ñ3°E¸9ÓEÀqÔIØ×Ñ˜Ÿ™¨Õ*r$   c                 óº   — | j                  «       }t        j                  |d«      }| j                  t	        |«      dt        |«      j                  › d|›d�«       y)z³
        L{twisted.python.deprecated._ModuleProxy.__repr__} produces a string
        containing the proxy type and a representation of the wrapped module
        object.
        rM   ú<z module=ú>N)r9   rH   rI   rJ   ÚreprÚtyper(   )r!   rC   Ú
realModules      r"   Ú	test_reprzModuleProxyTests.test_repr~   sQ   € ð —‘Ó!ˆÜ×,Ñ,¨U°IÓ>ˆ
Ø×Ñœ˜e›¨¬$¨u«+×*>Ñ*>Ð)?¸xÈ
À~ÐUVÐ&WÕXr$   N)
r(   r)   r*   r+   r9   rD   rK   rN   rR   rY   r,   r$   r"   r.   r.   B   s(   „ ñò+òLò	(òSò+óYr$   r.   c                   ó.   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚDeprecatedAttributeTestszÄ
    Tests for L{twisted.python.deprecate._DeprecatedAttribute} and
    L{twisted.python.deprecate.deprecatedModuleAttribute}, which issue
    warnings for deprecated module-level attributes.
    c                 ót   — t         j                  | _        t         j                  | _        t        dz   | _        y )Nz.foo)r   ÚversionÚmessager(   Ú_testModuleNamer&   s    r"   ÚsetUpzDeprecatedAttributeTests.setUp�   s)   € Ü+×3Ñ3ˆŒÜ+×3Ñ3ˆŒÜ'¨&Ñ0ˆÕr$   c                 ó�   — t        t        j                  dz   |z   t        j                  t        dz   t        j
                  z   «      S )zJ
        Create the warning string used by deprecated attributes.
        ú.z: )r   r   r(   r]   r	   r^   )r!   Úattrs     r"   Ú_getWarningStringz*DeprecatedAttributeTests._getWarningString•   sA   € ô ,Ü ×)Ñ)¨CÑ/°$Ñ6Ü ×(Ñ(Ü&¨Ñ-Ô0D×0LÑ0LÑLó
ð 	
r$   c                 óÐ  ‡— d}t        t        |d«       t        j                  t        || j                  | j
                  «      Š| j                  ‰j                  |«       ˆfd„} |«        | j                  | j                  g«      }| j                  |d   d   t        «       | j                  |d   d   | j                  |«      «       | j                  t        |«      d«       y)	zÛ
        L{twisted.python.deprecate._DeprecatedAttribute} correctly sets its
        __name__ to match that of the deprecated attribute and emits a warning
        when the original attribute value is accessed.
        ÚANOTHER_DEPRECATED_ATTRIBUTErG   c                  ó&   •— ‰ j                  «        y r   )r'   )rc   s   €r"   ÚaddStackLevelzNDeprecatedAttributeTests.test_deprecatedAttributeHelper.<locals>.addStackLevel¯   s   ø€ Ø�H‰H�Jr$   r   Úcategoryr^   rP   N)r4   r   r   Ú_DeprecatedAttributer]   r^   rJ   r(   ÚflushWarningsÚtest_deprecatedAttributeHelperr>   ÚDeprecationWarningrd   Úlen)r!   Únamerh   ÚwarningsShownrc   s       @r"   rl   z7DeprecatedAttributeTests.test_deprecatedAttributeHelperŸ   sÆ   ø€ ð .ˆÜÔ$ d¨BÔ/Ü×-Ñ-Ü  $¨¯©°d·l±ló
ˆð 	×Ñ˜Ÿ™¨Ô-ô	ñ 	ŒØ×*Ñ*¨D×,OÑ,OÐ+PÓQˆØ�‰�m AÑ& zÑ2Ô4FÔGØ×Ñ˜ qÑ)¨)Ñ4°d×6LÑ6LÈTÓ6RÔSØ×Ñœ˜]Ó+¨QÕ/r$   c                 óª  — t         j                   | j                  | j                  g«      }| j	                  t        |«      d«       d}t        t         |«       | j                  | j                  g«      }| j	                  t        |«      d«       | j                  |d   d   t        «       | j	                  |d   d   | j                  |«      «       y)a  
        L{twisted.python.deprecate.deprecatedModuleAttribute} wraps a
        module-level attribute in an object that emits a deprecation warning
        when it is accessed the first time only, while leaving other unrelated
        attributes alone.
        r   ÚDEPRECATED_ATTRIBUTErP   ri   r^   N)
r   ÚANOTHER_ATTRIBUTErk   Útest_deprecatedAttributerJ   rn   rA   r>   rm   rd   )r!   rp   ro   s      r"   rt   z1DeprecatedAttributeTests.test_deprecatedAttribute¹   s¹   € ô 	×.Ò.Ø×*Ñ*¨D×,IÑ,IÐ+JÓKˆØ×Ñœ˜]Ó+¨QÔ/à%ˆô 	Ô$ dÔ+à×*Ñ*¨D×,IÑ,IÐ+JÓKˆØ×Ñœ˜]Ó+¨QÔ/Ø�‰�m AÑ& zÑ2Ô4FÔGØ×Ñ˜ qÑ)¨)Ñ4°d×6LÑ6LÈTÓ6RÕSr$   c                 ót  — t        j                  d«      xt        j                  | j                  <   }| j                  t        j                  j                  | j                  «       t        |dd«       t        |dd«       t        j                  t        dddd«      d	| j                  d«       t        j                  | j                     }| j                  ||«       t        j                  t        dddd«      d	| j                  d«       | j                  |t        j                  | j                     «       y
)zï
        Deprecating an attribute in a module replaces and wraps that module
        instance, in C{sys.modules}, with a
        L{twisted.python.deprecate._ModuleProxy} instance but only if it hasn't
        already been wrapped.
        r0   ÚfirstrP   Úsecondé   ÚTwistedé   r   r^   N)r1   r2   ÚsysÚmodulesr_   Ú
addCleanupÚpopr4   r   ÚdeprecatedModuleAttributer   rQ   r>   )r!   r7   rC   s      r"   Útest_wrappedModulez+DeprecatedAttributeTests.test_wrappedModuleÐ   sñ   € ô 38×2BÑ2BÀ5Ó2IÐIŒ�‰�D×(Ñ(Ñ)¨CØ�‰œŸ™Ÿ™¨×)=Ñ)=Ô>ä��W˜aÔ Ü��X˜qÔ!ä×+Ñ+Ü�I˜q ! QÓ'¨°D×4HÑ4HÈ'ô	
ô —‘˜D×0Ñ0Ñ1ˆØ×Ñ˜E 3Ô'ä×+Ñ+Ü�I˜q ! QÓ'¨°D×4HÑ4HÈ(ô	
ð 	�‰�eœSŸ[™[¨×)=Ñ)=Ñ>Õ?r$   N)	r(   r)   r*   r+   r`   rd   rl   rt   r€   r,   r$   r"   r[   r[   ‰   s"   „ ñò1ò

ò0ò4Tó.@r$   r[   c                   ó2   — e Zd ZdZdZd„ Zd„ Zd„ Zd„ Zd„ Z	y)	ÚImportedModuleAttributeTestsza
    Tests for L{deprecatedModuleAttribute} which involve loading a module via
    'import'.
    z»from twisted.python.deprecate import deprecatedModuleAttribute
from incremental import Version

deprecatedModuleAttribute(
    Version('Package', 1, 2, 3), 'message', __name__, 'module')
c                 óf  ‡— ˆfd„Št        | j                  «       j                  d«      «      }|j                  «         ‰||«      }| j	                  |j
                  j                  d«      gt        j
                  z   «       | j                  t        j                  j                  «       «       |S )a_  
        Create some files in a hierarchy, based on a dictionary describing those
        files.  The resulting hierarchy will be placed onto sys.path for the
        duration of the test.

        @param tree: A dictionary representing a directory structure.  Keys are
            strings, representing filenames, dictionary values represent
            directories, string values represent file contents.

        @return: another dictionary similar to the input, with file content
            strings replaced with L{FilePath} objects pointing at where those
            contents are now stored.
        c                 ó  •— i }|j                  «       D ]t  \  }}| j                  |«      }t        |t        «      r|||<   |j	                  |«       Œ>t        |t
        «      r|j                  «         ‰||«      ||<   Œkt        d«      ‚ |S )Nz(only strings and dicts allowed as values)r3   ÚchildÚ
isinstanceÚbytesÚ
setContentÚdictÚcreateDirectoryÚ
ValueError)ÚpathobjÚdirdictÚpathdictr8   r   r…   ÚmakeSomeFiless         €r"   r�   zAImportedModuleAttributeTests.pathEntryTree.<locals>.makeSomeFiles  s‹   ø€ ØˆHØ%Ÿm™m›oò 	Q‘
��UØŸ™ cÓ*�Ü˜e¤UÔ+Ø$)�H˜S‘MØ×$Ñ$ UÕ+Ü ¤tÔ,Ø×)Ñ)Ô+Ù$1°%¸Ó$?�H˜S’Mä$Ð%OÓPÐPð	Qð ˆOr$   úutf-8)r   ÚmktempÚencodeÚmakedirsÚreplaceSysPathÚpathÚdecoder{   ÚreplaceSysModulesr|   Úcopy)r!   ÚtreeÚbaseÚresultr�   s       @r"   ÚpathEntryTreez*ImportedModuleAttributeTests.pathEntryTreeù   sƒ   ø€ ô	ô ˜Ÿ™›×,Ñ,¨WÓ5Ó6ˆØ�‰Œá˜t TÓ*ˆà×Ñ˜TŸY™Y×-Ñ-¨gÓ6Ð7¼#¿(¹(ÑBÔCØ×ÑœsŸ{™{×/Ñ/Ó1Ô2Øˆr$   c                 óp   — | j                  d| j                  j                  d«      ddœi«      }|d   d   S )z¢
        Add a sample module and package to the path, returning a L{FilePath}
        pointing at the module which will be loadable as C{package.module}.
        s   packager�   r$   )s   __init__.pyó	   module.pyrž   )rœ   Ú_packageInitr’   )r!   Úpathss     r"   ÚsimpleModuleEntryz.ImportedModuleAttributeTests.simpleModuleEntry  sJ   € ð
 ×"Ñ"àØ$(×$5Ñ$5×$<Ñ$<¸WÓ$EØ"%ñðó
ˆð �ZÑ  Ñ.Ð.r$   c                 óN  — ddl m} | j                  t        |j                  j                  d«      «      |«       | j                  | j                  g«      }| j                  t        |«      d«       | j                  |d   d   d«       | j                  |d   d   t        «       y)	zB
        Verification logic for L{test_deprecatedModule}.
        r   ©Úmoduler�   rP   r^   z7package.module was deprecated in Package 1.2.3: messageri   N)
Úpackager¤   rJ   r   Ú__file__r’   rk   ÚcheckOneWarningrn   rm   )r!   Ú
modulePathr¤   Úemitteds       r"   r§   z,ImportedModuleAttributeTests.checkOneWarning.  s‘   € õ 	#à×Ñœ &§/¡/×"8Ñ"8¸Ó"AÓBÀJÔOØ×$Ñ$ d×&:Ñ&:Ð%;Ó<ˆØ×Ñœ˜W› qÔ)Ø×ÑØ�A‰J�yÑ!ØHô	
ð 	×Ñ˜ ™ JÑ/Ô1CÕDr$   c                 óB   — | j                  | j                  «       «       y)zÇ
        If L{deprecatedModuleAttribute} is used to deprecate a module attribute
        of a package, only one deprecation warning is emitted when the
        deprecated module is imported.
        N)r§   r¡   r&   s    r"   Útest_deprecatedModulez2ImportedModuleAttributeTests.test_deprecatedModule=  s   € ð 	×Ñ˜T×3Ñ3Ó5Õ6r$   c                 óª   — | j                  «       }| j                  |«       | j                  |«       t        d«      D ]  }| j                  |«       Œ y)zÔ
        If L{deprecatedModuleAttribute} is used to deprecate a module attribute
        of a package, only one deprecation warning is emitted when the
        deprecated module is subsequently imported.
        rx   N)r¡   r§   Úrange)r!   ÚmpÚxs      r"   Ú"test_deprecatedModuleMultipleTimesz?ImportedModuleAttributeTests.test_deprecatedModuleMultipleTimesE  sS   € ð ×#Ñ#Ó%ˆà×Ñ˜RÔ ð 	×Ñ˜RÔ ô �q“ò 	%ˆAØ× Ñ  Õ$ñ	%r$   N)
r(   r)   r*   r+   rŸ   rœ   r¡   r§   r«   r°   r,   r$   r"   r‚   r‚   ë   s)   „ ñð
€Lò$òL/òEò7ó%r$   r‚   c                   ó@   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zy
)ÚWarnAboutFunctionTestsz¢
    Tests for L{twisted.python.deprecate.warnAboutFunction} which allows the
    callers of a function to issue a C{DeprecationWarning} about that function.
    c                 ó  ‡— t        | j                  «       «      j                  d«      | _        | j                  j	                  «        | j                  j                  d«      j                  d«       | j                  j                  d«      j                  d«       | j                  j                  d«      j                  d«       | j                  j                  «       j                  }t        j                  j                  d|«       | j                  t        j                  j                  |«       t        j                  j                  «       Š| j                  ˆfd	„«       t        j                  «       r| j!                  «        y
y
)zY
        Create a file that will have known line numbers when emitting warnings.
        Útwisted_private_helperz__init__.pyr$   z	module.pys  
"A module string"

from twisted.python import deprecate

def testFunction():
    "A doc string"
    a = 1 + 2
    return a

def callTestFunction():
    b = testFunction()
    if b == 3:
        deprecate.warnAboutFunction(testFunction, "A Warning String")
z	pep626.pysQ  
"A module string"

from twisted.python import deprecate

def noop():
    pass

def testFunction(a=1, b=1):
    "A doc string"
    if a:
        if b:
            noop()
        else:
            pass

def callTestFunction():
    b = testFunction()
    if b is None:
        deprecate.warnAboutFunction(testFunction, "A Warning String")
r   c                  ó~   •— t         j                  j                  «       t         j                  j                  ‰ «      fS r   )r{   r|   ÚclearÚupdate)r|   s   €r"   ú<lambda>z.WarnAboutFunctionTests.setUp.<locals>.<lambda>•  s(   ø€ ¤§¡×!2Ñ!2Ó!4´c·k±k×6HÑ6HÈÓ6QÐ R€ r$   N)r   r‘   r…   r¥   r“   rˆ   Úparentr•   r{   Úinsertr}   Úremover|   r˜   r   Ú	isWindowsrk   )r!   ÚpackagePathr|   s     @r"   r`   zWarnAboutFunctionTests.setUp`  s  ø€ ô   §¡£Ó.×4Ñ4Ð5MÓNˆŒØ�‰×ÑÔØ�‰×Ñ˜=Ó)×4Ñ4°SÔ9Ø�‰×Ñ˜;Ó'×2Ñ2ðô	
ð" 	�‰×Ñ˜;Ó'×2Ñ2ðô	
ð0 —l‘l×)Ñ)Ó+×0Ñ0ˆÜ�‰�‰˜˜;Ô'Ø�‰œŸ™Ÿ™¨Ô5ä—+‘+×"Ñ"Ó$ˆØ�‰ÓRÔSô
 ×ÑÔØ×ÑÕ ð  r$   c                 ó.  — d„ }t        j                  |d«       | j                  «       }t        }|j	                  «       j                  d«      r|dd }| j                  t        |d   d   «      t        |«      «       | j                  |d   d   d«       y)	z½
        L{deprecate.warnAboutFunction} emits a warning the file and line number
        of which point to the beginning of the implementation of the function
        passed to it.
        c                   ó   — y r   r,   r,   r$   r"   ÚaFuncz2WarnAboutFunctionTests.test_warning.<locals>.aFunc¤  ó   € Ør$   zA Warning Messagez.pycNéÿÿÿÿr   Úfilenamer^   )	r   ÚwarnAboutFunctionrk   r¦   ÚlowerÚendswithÚassertSamePathr   rJ   )r!   rÀ   rp   rÃ   s       r"   Útest_warningz#WarnAboutFunctionTests.test_warning�  sŒ   € ò	ô 	×#Ñ# EÐ+>Ô?Ø×*Ñ*Ó,ˆÜˆØ�>‰>Ó×$Ñ$ VÔ,Ø  �}ˆHØ×ÑœH ]°1Ñ%5°jÑ%AÓBÄHÈXÓDVÔWØ×Ñ˜ qÑ)¨)Ñ4Ð6IÕJr$   c                 ó–  — ddl m} |j                  «        | j                  «       }| j	                  t        |d   d   j                  d«      «      | j                  j                  d«      j                  d«      «       | j                  |d   d   d«       | j                  |d   d	   d
«       | j                  t        |«      d«       y)z¨
        L{deprecate.warnAboutFunction} emits a C{DeprecationWarning} with the
        number of a line within the implementation of the function passed to it.
        r   r£   rÃ   r�   ó   twisted_private_helperrž   Úlinenoé	   r^   úA Warning StringrP   N)r´   r¤   ÚcallTestFunctionrk   rÇ   r   r’   r¥   Úsiblingr…   rJ   rn   ©r!   r¤   rp   s      r"   Útest_warningLineNumberz-WarnAboutFunctionTests.test_warningLineNumber¯  s¶   € õ
 	2à×ÑÔ!Ø×*Ñ*Ó,ˆØ×ÑÜ�] 1Ñ% jÑ1×8Ñ8¸ÓAÓBØ�L‰L× Ñ Ð!:Ó;×AÑAÀ,ÓOô	
ð 	×Ñ˜ qÑ)¨(Ñ3°QÔ7Ø×Ñ˜ qÑ)¨)Ñ4Ð6HÔIØ×Ñœ˜]Ó+¨QÕ/r$   c                 ó–  — ddl m} |j                  «        | j                  «       }| j	                  t        |d   d   j                  d«      «      | j                  j                  d«      j                  d«      «       | j                  |d   d   d«       | j                  |d   d	   d
«       | j                  t        |«      d«       y)zã
        L{deprecate.warnAboutFunction} emits a C{DeprecationWarning} with the
        number of a line within the implementation handling the case in which
        dis.findlinestarts returns the lines in random order.
        r   )Úpep626rÃ   r�   rÊ   s	   pep626.pyrË   é   r^   rÍ   rP   N)r´   rÓ   rÎ   rk   rÇ   r   r’   r¥   rÏ   r…   rJ   rn   )r!   rÓ   rp   s      r"   Ú'test_warningLineNumberDisFindlinestartsz>WarnAboutFunctionTests.test_warningLineNumberDisFindlinestartsÂ  s¶   € õ 	2à×ÑÔ!Ø×*Ñ*Ó,ˆØ×ÑÜ�] 1Ñ% jÑ1×8Ñ8¸ÓAÓBØ�L‰L× Ñ Ð!:Ó;×AÑAÀ,ÓOô	
ð 	×Ñ˜ qÑ)¨(Ñ3°RÔ8Ø×Ñ˜ qÑ)¨)Ñ4Ð6HÔIØ×Ñœ˜]Ó+¨QÕ/r$   c                 ó„   — | j                  t        |j                  «      t        |j                  «      k(  |›d|›�«       y)a  
        Assert that the two paths are the same, considering case normalization
        appropriate for the current platform.

        @type first: L{FilePath}
        @type second: L{FilePath}

        @raise C{self.failureType}: If the paths are not the same.
        z != N)Ú
assertTruer   r•   )r!   rv   rw   s      r"   rÇ   z%WarnAboutFunctionTests.assertSamePathÖ  s8   € ð 	�‰Ü�U—Z‘ZÓ ¤H¨V¯[©[Ó$9Ñ9Øˆi�t˜F˜:Ð&õ	
r$   c                 ó^  — ddl m} t        j                  d= t        j                  |j                  = | j
                  j                  | j
                  j                  d«      «       t        r
t        «        ddl	m} | j                  t        j                  j                  d«       | j                  t        j                  j                  |j                  «       |j                  «        | j                  |j                  g«      }t        |d   d   j!                  d«      «      }| j
                  j                  d«      j#                  d«      }| j%                  ||«       | j'                  |d   d	   d
«       | j'                  |d   d   d«       | j'                  t)        |«      d«       y)a  
        Even if the implementation of a deprecated function is moved around on
        the filesystem, the line number in the warning emitted by
        L{deprecate.warnAboutFunction} points to a line in the implementation of
        the deprecated function.
        r   r£   r´   s   twisted_renamed_helperÚtwisted_renamed_helperrÃ   r�   rž   rË   rÌ   r^   rÍ   rP   N)r´   r¤   r{   r|   r(   r¥   ÚmoveTorÏ   r   rÙ   r}   r~   rÎ   rk   ÚtestFunctionr   r’   r…   rÇ   rJ   rn   )r!   r¤   rp   Ú
warnedPathÚexpectedPaths        r"   Útest_renamedFilez'WarnAboutFunctionTests.test_renamedFileå  sN  € õ 	2ô �K‰KÐ0Ð1Ü�K‰K˜Ÿ™Ð(ð 	�‰×Ñ˜DŸL™L×0Ñ0Ð1JÓKÔLõ ÜÔõ 	2à�‰œŸ™Ÿ™Ð)AÔBØ�‰œŸ™Ÿ™¨¯©Ô9à×ÑÔ!Ø×*Ñ*¨F×,?Ñ,?Ð+@ÓAˆÜ˜m¨AÑ.¨zÑ:×AÑAÀ'ÓJÓKˆ
Ø—|‘|×+Ñ+Ð,EÓF×LÑLØó
ˆð 	×Ñ˜J¨Ô5Ø×Ñ˜ qÑ)¨(Ñ3°QÔ7Ø×Ñ˜ qÑ)¨)Ñ4Ð6HÔIØ×Ñœ˜]Ó+¨QÕ/r$   c                 óÚ   — t         j                  dd…= t        j                  dd¬«       ddlm} |j                  «        | j                  «       }| j                  t        |«      d«       y)z¾
        L{deprecate.warnAboutFunction} emits a warning that will be filtered if
        L{warnings.filterwarning} is called with the module name of the
        deprecated function.
        NÚignorer´   ©Úactionr¤   r   r£   )	ÚwarningsÚfiltersÚfilterwarningsr´   r¤   rÎ   rk   rJ   rn   rÐ   s      r"   Útest_filteredWarningz+WarnAboutFunctionTests.test_filteredWarning  sU   € ô ×ÑšQÐä×Ñ xÐ8PÕQå1à×ÑÔ!à×*Ñ*Ó,ˆØ×Ñœ˜]Ó+¨QÕ/r$   c                 ó²  — t         j                  dd…= t        j                  dd¬«       ddlm} |j                  «        |j                  «        | j                  «       }| j                  t        |«      d«       |d   d   }|d   d	   }|d   d
   }|d   d   }t        j                  ||||«      }| j                  |j                  d«      d|›�«       y)zÙ
        L{deprecate.warnAboutFunction} emits a warning that will be filtered
        once if L{warnings.filterwarning} is called with the module name of the
        deprecated function and an action of once.
        Nr¤   r´   rá   r   r£   rP   r^   ri   rÃ   rË   z=module.py:9: DeprecationWarning: A Warning String
  return a
zUnexpected warning string: )rã   rä   rå   r´   r¤   rÎ   rk   rJ   rn   Úformatwarningr×   rÆ   )r!   r¤   rp   r^   ri   rÃ   rË   Úmsgs           r"   Útest_filteredOnceWarningz/WarnAboutFunctionTests.test_filteredOnceWarning  sÚ   € ô ×ÑšQÐä×Ñ xÐ8PÕQå1à×ÑÔ!Ø×ÑÔ!à×*Ñ*Ó,ˆØ×Ñœ˜]Ó+¨QÔ/Ø Ñ" 9Ñ-ˆØ  Ñ# JÑ/ˆØ  Ñ# JÑ/ˆØ˜qÑ! (Ñ+ˆÜ×$Ñ$ W¨h¸À&ÓIˆØ�‰Ø�L‰LØTóð *¨#¨Ð1õ		
r$   N)r(   r)   r*   r+   r`   rÈ   rÑ   rÕ   rÇ   rÞ   ræ   rê   r,   r$   r"   r²   r²   Z  s2   „ ñò
;!òzKò$0ò&0ò(
ò$0òL0ó(
r$   r²   c                   ó   — y)zK
    Do nothing.

    This is used to test the deprecation decorators.
    Nr,   r,   r$   r"   ÚdummyCallablerì   @  ó   � r$   c                   ó   — y)z[
    Do nothing.

    This is used to test the replacement parameter to L{deprecated}.
    Nr,   r,   r$   r"   ÚdummyReplacementMethodrï   H  rí   r$   c                   óB   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zy
)ÚDeprecationWarningsTestsc                 óz   — t        dddd«      }| j                  t        | j                  |«      t        ›d�«       y)z 
        L{getDeprecationWarningString} returns a string that tells us that a
        callable was deprecated at a certain released version of Twisted.
        ry   rz   r   zZ.DeprecationWarningsTests.test_getDeprecationWarningString was deprecated in Twisted 8.0.0N)r   rJ   r   Ú test_getDeprecationWarningStringr(   ©r!   r]   s     r"   ró   z9DeprecationWarningsTests.test_getDeprecationWarningStringQ  s:   € ô
 ˜) Q¨¨1Ó-ˆØ×ÑÜ'¨×(MÑ(MÈwÓWæ19ð<õ	
r$   c                 óŽ   — t        dddd«      }t        dz   }| j                  t        | j                  ||«      t
        ›d�«       y)zð
        L{getDeprecationWarningString} returns a string that tells us that a
        callable was deprecated at a certain released version of Twisted, with
        a message containing additional information about the deprecation.
        ry   rz   r   z: This is a messagezm.DeprecationWarningsTests.test_getDeprecationWarningString was deprecated in Twisted 8.0.0: This is a messageN)r   r	   rJ   r   ró   r(   )r!   r]   Úformats      r"   Ú*test_getDeprecationWarningStringWithFormatzCDeprecationWarningsTests.test_getDeprecationWarningStringWithFormat]  sO   € ô ˜) Q¨¨1Ó-ˆÜ+Ð.CÑCˆØ×ÑÜ'Ø×5Ñ5°wÀóö AIðKõ		
r$   c                 óð  ‡— t        dddd«      } t        |«      t        «      Šˆfd„}t        d¬«      5 }t	        d«        |«        | j                  |d   j                  t        «       | j                  t        |d   j                  «      t        t        |«      «       | j                  |d   j                  j                  d«      t        j                  d«      «       d	d	d	«       y	# 1 sw Y   y	xY w)
zK
        Decorating a callable with L{deprecated} emits a warning.
        ry   rz   r   c                  ó   •—  ‰ «        y r   r,   )Údummys   €r"   rh   zJDeprecationWarningsTests.test_deprecateEmitsWarning.<locals>.addStackLevelt  s   ø€ Ù�Gr$   T©ÚrecordÚalwaysÚcoN)r   r   rì   r   r   rJ   ri   rm   Ústrr^   r   rÃ   Úrstripr¦   )r!   r]   rh   Úcaughtrú   s       @r"   Útest_deprecateEmitsWarningz3DeprecationWarningsTests.test_deprecateEmitsWarningm  sÒ   ø€ ô ˜) Q¨¨1Ó-ˆØ#”
˜7Ó#¤MÓ2ˆô	ô  4Ô(ð 		U¨FÜ˜Ô"ÙŒOØ×Ñ˜V A™Y×/Ñ/Ô1CÔDØ×ÑÜ�F˜1‘I×%Ñ%Ó&Ü+¬M¸7ÓCôð
 ×Ñ˜V A™Y×/Ñ/×6Ñ6°tÓ<¼h¿o¹oÈdÓ>SÔT÷		U÷ 		Uñ 		Uús   ¶B-C,Ã,C5c                 óî   — t        dddd«      } t        |«      t        «      }| j                  t        j                  |j                  «       | j                  t        t        «      t        |«      «       y)zK
        The decorated function has the same name as the original.
        ry   rz   r   N)r   r   rì   rJ   r(   ÚfullyQualifiedName©r!   r]   rú   s      r"   Útest_deprecatedPreservesNamez5DeprecationWarningsTests.test_deprecatedPreservesName‚  s[   € ô ˜) Q¨¨1Ó-ˆØ#”
˜7Ó#¤MÓ2ˆØ×Ñœ×/Ñ/°·±Ô@Ø×ÑÔ+¬MÓ:Ô<NÈuÓ<UÕVr$   c                 óX   — t        dddd«      }| j                  dt        |d«      «       y)zr
        L{_getDeprecationDocstring} returns a note about the deprecation to go
        into a docstring.
        ry   rz   r   zDeprecated in Twisted 8.0.0.Ú N)r   rJ   r   rô   s     r"   Útest_getDeprecationDocstringz5DeprecationWarningsTests.test_getDeprecationDocstring‹  s/   € ô
 ˜) Q¨¨1Ó-ˆØ×ÑØ*Ô,DÀWÈbÓ,Qõ	
r$   c                 óÀ   — d„ }t        dddd«      } t        |«      |«      }t        |t        |d«      «       | j	                  |j
                  |j
                  «       y)zv
        The docstring of the deprecated function is appended with information
        about the deprecation.
        c                   ó   — y)zc
            Do nothing.

            This is used to test the deprecation decorators.
            Nr,   r,   r$   r"   ÚlocalDummyCallablezTDeprecationWarningsTests.test_deprecatedUpdatesDocstring.<locals>.localDummyCallable›  rí   r$   ry   rz   r   r  N)r   r   r
   r   rJ   r+   )r!   r  r]   rú   s       r"   Útest_deprecatedUpdatesDocstringz8DeprecationWarningsTests.test_deprecatedUpdatesDocstring•  sZ   € ò	ô ˜) Q¨¨1Ó-ˆØ#”
˜7Ó#Ð$6Ó7ˆäÐ-Ô/GÈÐQSÓ/TÔUà×ÑÐ+×3Ñ3°U·]±]ÕCr$   c                 ó‚   — t        dddd«      } t        |«      t        «      }| j                  ||j                  «       y)zt
        Deprecating a function adds version information to the decorated
        version of that function.
        ry   rz   r   N)r   r   rì   rJ   ÚdeprecatedVersionr  s      r"   Útest_versionMetadataz-DeprecationWarningsTests.test_versionMetadata©  s;   € ô
 ˜) Q¨¨1Ó-ˆØ#”
˜7Ó#¤MÓ2ˆØ×Ñ˜ %×"9Ñ"9Õ:r$   c                 ó    — t        dddd«      }t        | j                  |d¬«      }| j                  |t	        | j                  «      ›d�«       y)a  
        L{getDeprecationWarningString} takes an additional replacement parameter
        that can be used to add information to the deprecation.  If the
        replacement parameter is a string, it will be interpolated directly into
        the result.
        ry   rz   r   úsomething.foobar©ÚreplacementzE was deprecated in Twisted 8.0.0; please use something.foobar insteadN)r   r   ró   rJ   r  ©r!   r]   ÚwarningStrings      r"   Ú+test_getDeprecationWarningStringReplacementzDDeprecationWarningsTests.test_getDeprecationWarningStringReplacement²  sT   € ô ˜) Q¨¨1Ó-ˆÜ3Ø×1Ñ1ØØ*ô
ˆð
 	×ÑØä+¨D×,QÑ,QÕRðUõ	
r$   c                 ó¶   — t        dddd«      }t        | j                  |t        ¬«      }| j	                  |t        | j                  «      ›dt        ›d�«       y)a  
        L{getDeprecationWarningString} takes an additional replacement parameter
        that can be used to add information to the deprecation. If the
        replacement parameter is a callable, its fully qualified name will be
        interpolated into the result.
        ry   rz   r   r  z- was deprecated in Twisted 8.0.0; please use z.dummyReplacementMethod insteadN)r   r   ró   rï   rJ   r  r(   r  s      r"   Ú7test_getDeprecationWarningStringReplacementWithCallablezPDeprecationWarningsTests.test_getDeprecationWarningStringReplacementWithCallableÅ  sX   € ô ˜) Q¨¨1Ó-ˆÜ3Ø×1Ñ1ØÜ.ô
ˆð
 	×ÑØô " $×"GÑ"GÕHÎ(ðTõ	
r$   N)r(   r)   r*   ró   r÷   r  r  r	  r  r  r  r  r,   r$   r"   rñ   rñ   P  s2   „ ò

ò
ò Uò*Wò
òDò(;ò
ó&
r$   rñ   ry   rP   rx   é   c                   ó   — e Zd ZdZy)ÚDeprecatedClasszJ
    Class which is entirely deprecated without having a replacement.
    N)r(   r)   r*   r+   r,   r$   r"   r  r  Ú  s   „ òr$   r  c                   óf   — e Zd ZdZdZ e edddd«      «      d„ «       Zej                  d„ «       Zy)	ÚClassWithDeprecatedPropertyz2
    Class with a single deprecated property.
    Nry   rP   rx   r  c                 ó   — | j                   S )zC
        Getter docstring.

        @return: The property.
        ©Ú_someProtectedValuer&   s    r"   ÚsomePropertyz(ClassWithDeprecatedProperty.somePropertyè  s   € ð ×'Ñ'Ð'r$   c                 ó   — || _         y)z#
        Setter docstring.
        Nr   r    s     r"   r"  z(ClassWithDeprecatedProperty.somePropertyñ  s   € ð
 $)ˆÕ r$   )	r(   r)   r*   r+   r!  r   r   r"  Úsetterr,   r$   r"   r  r  á  sK   „ ñð Ðá™ 	¨1¨a°Ó3Ó4ñ(ó 5ð(ð ×Ññ)ó ñ)r$   r  é   r0   c                  ó   — y)z7
    Function with a deprecated keyword parameter.
    Nr,   )ÚaÚbÚcr0   Úbars        r"   ÚfunctionWithDeprecatedParameterr+  ù  rí   r$   c                   ó:   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
y	)
ÚDeprecatedDecoratorTestsz*
    Tests for deprecated decorators.
    c                 ó¼   — | j                  ||j                  j                  «       D �cg c]#  }|j                  «       sŒ|j                  «       ‘Œ% c}«       yc c}w )a8  
        Check that C{target} object has the C{expected} docstring lines.

        @param target: Object which is checked.
        @type target: C{anything}

        @param expected: List of lines, ignoring empty lines or leading or
            trailing spaces.
        @type expected: L{list} or L{str}
        N)rJ   r+   Ú
splitlinesÚstrip)r!   ÚtargetÚexpectedr¯   s       r"   ÚassertDocstringz(DeprecatedDecoratorTests.assertDocstring  s@   € ð 	×ÑØ¨&¯.©.×*CÑ*CÓ*EÖS QÈÏÉÍ�q—w‘w•yÒSõ	
ùÚSs
   ©A
¿A
c                 ó�  — t        «       }|j                   | j                  t         j                  g d¢«       t        dddd«      t         j                  _        d}| j                  | j                  g«      }| j                  dt        |«      «       | j                  t        |d   d   «       | j                  ||d   d	   «       y
)a%  
        When L{deprecatedProperty} is used on a C{property}, accesses raise a
        L{DeprecationWarning} and getter docstring is updated to inform the
        version in which it was deprecated. C{deprecatedVersion} attribute is
        also set to inform the deprecation version.
        )zGetter docstring.z@return: The property.úDeprecated in Twisted 1.2.3.ry   rP   rx   r  úktwisted.python.test.test_deprecate.ClassWithDeprecatedProperty.someProperty was deprecated in Twisted 1.2.3r   ri   r^   N)
r  r"  r3  r   r  rk   Útest_propertyGetterrJ   rn   rm   )r!   Úobjr^   rã   s       r"   r7  z,DeprecatedDecoratorTests.test_propertyGetter  s¿   € ô *Ó+ˆà×Òà×ÑÜ'×4Ñ4òô	
ô FMØ�q˜!˜QóF
Ô#×0Ñ0ÔBð
;ð 	ð ×%Ñ% t×'?Ñ'?Ð&@ÓAˆØ×Ñ˜œC ›MÔ*Ø×ÑÔ+¨X°a©[¸Ñ-DÔEØ×Ñ˜ (¨1¡+¨iÑ"8Õ9r$   c                 óL  — t        «       }t        «       }||_        | j                  ||j                  «       d}| j                  | j                  g«      }| j                  dt        |«      «       | j                  t        |d   d   «       | j                  ||d   d   «       y)z}
        When L{deprecatedProperty} is used on a C{property}, setter accesses
        raise a L{DeprecationWarning}.
        r6  rP   r   ri   r^   N)
rH   r  r"  r>   r!  rk   Útest_propertySetterrJ   rn   rm   )r!   ÚnewValuer8  r^   rã   s        r"   r:  z,DeprecatedDecoratorTests.test_propertySetter4  s›   € ô
 “8ˆÜ)Ó+ˆà#ˆÔà�‰�h × 7Ñ 7Ô8ð;ð 	ð ×%Ñ% t×'?Ñ'?Ð&@ÓAˆØ×Ñ˜œC ›MÔ*Ø×ÑÔ+¨X°a©[¸Ñ-DÔEØ×Ñ˜ (¨1¡+¨iÑ"8Õ9r$   c                 óP  — t        «        | j                  t         ddg«       t        dddd«      t         _        d}| j	                  | j
                  g«      }| j                  dt        |«      «       | j                  t        |d   d	   «       | j                  ||d   d
   «       y)a  
        When L{deprecated} is used on a class, instantiations raise a
        L{DeprecationWarning} and class's docstring is updated to inform the
        version in which it was deprecated. C{deprecatedVersion} attribute is
        also set to inform the deprecation version.
        z@Class which is entirely deprecated without having a replacement.r5  ry   rP   rx   r  zRtwisted.python.test.test_deprecate.DeprecatedClass was deprecated in Twisted 1.2.3r   ri   r^   N)	r  r3  r   r  rk   Ú
test_classrJ   rn   rm   )r!   r^   rã   s      r"   r=  z#DeprecatedDecoratorTests.test_classH  s¥   € ô 	Ôà×ÑÜàVØ.ðô	
ô -4°I¸qÀ!ÀQÓ,GŒÔ)ð.ð 	ð ×%Ñ% t§¡Ð&7Ó8ˆØ×Ñ˜œC ›MÔ*Ø×ÑÔ+¨X°a©[¸Ñ-DÔEØ×Ñ˜ (¨1¡+¨iÑ"8Õ9r$   c                 ó„   — t        dddd«      } t        |d«      t        «      }| j                  |j                  d«       y)a  
        L{deprecated} takes an additional replacement parameter that can be used
        to indicate the new, non-deprecated method developers should use.  If
        the replacement parameter is a string, it will be interpolated directly
        into the warning message.
        ry   rz   r   r  z’
    Do nothing.

    This is used to test the deprecation decorators.

    Deprecated in Twisted 8.0.0; please use something.foobar instead.
    N)r   r   rì   rJ   r+   r  s      r"   Útest_deprecatedReplacementz3DeprecatedDecoratorTests.test_deprecatedReplacementc  sB   € ô ˜) Q¨¨1Ó-ˆØ7”
˜7Ð$6Ó7¼ÓFˆØ×ÑØ�M‰Mðõ		
r$   c                 ó¢   — t        dddd«      }t        |t        ¬«      } |t        «      }| j	                  |j
                  dt        ›d�«       y)a)  
        L{deprecated} takes an additional replacement parameter that can be used
        to indicate the new, non-deprecated method developers should use.  If
        the replacement parameter is a callable, its fully qualified name will
        be interpolated into the warning message.
        ry   rz   r   r  zt
    Do nothing.

    This is used to test the deprecation decorators.

    Deprecated in Twisted 8.0.0; please use z%.dummyReplacementMethod instead.
    N)r   r   rï   rì   rJ   r+   r(   )r!   r]   Ú	decoratorrú   s       r"   Ú&test_deprecatedReplacementWithCallablez?DeprecatedDecoratorTests.test_deprecatedReplacementWithCallablew  sJ   € ô ˜) Q¨¨1Ó-ˆÜ˜wÔ4JÔKˆ	Ùœ-Ó(ˆØ×ÑØ�MŠMö ð!õ	
r$   c                 ó
  — d}t        d¬«      5 }t        d«       t        dd«       | j                  |g «       t        ddd«       | j                  |g «       t        ddd¬	«       | j                  t	        |«      d
«       | j                  |d   j
                  t        «       | j                  t        |d   j                  «      |«       |j                  «        t        ddd¬«       | j                  |g «       t        dddd«       | j                  t	        |«      d
«       | j                  |d   j
                  t        «       | j                  t        |d   j                  «      |«       d d d «       y # 1 sw Y   y xY w)NzzThe 'foo' parameter to twisted.python.test.test_deprecate.functionWithDeprecatedParameter was deprecated in Twisted 19.2.0Trû   rý   é
   é   é   é(   )r0   rP   r   é2   )r*  )
r   r   r+  rJ   rn   ri   rm   rÿ   r^   r¶   )r!   r^   Úwss      r"   Útest_deprecatedKeywordParameterz8DeprecatedDecoratorTests.test_deprecatedKeywordParameter‹  s>  € ð/ð 	ô  4Ô(ð 	:¨BÜ˜Ô"ä+¨B°Ô3Ø×Ñ˜R Ô$ä+¨B°°BÔ7Ø×Ñ˜R Ô$ä+¨B°¸Õ;Ø×ÑœS ›W aÔ(Ø×Ñ˜R ™UŸ^™^Ô-?Ô@Ø×ÑœS  A¡§¡Ó/°Ô9à�H‰HŒJÜ+¨B°¸Õ;Ø×Ñ˜R Ô$ä+¨B°°B¸Ô;Ø×ÑœS ›W aÔ(Ø×Ñ˜R ™UŸ^™^Ô-?Ô@Ø×ÑœS  A¡§¡Ó/°Ô9÷+	:÷ 	:ñ 	:ús   �E!E9Å9FN)r(   r)   r*   r+   r3  r7  r:  r=  r?  rB  rJ  r,   r$   r"   r-  r-     s+   „ ñò
ò:ò@:ò(:ò6
ò(
ó(:r$   r-  c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)ÚAppendToDocstringTestszk
    Test the _appendToDocstring function.

    _appendToDocstring is used to add text to a docstring.
    c                 óZ   — d„ }t        |d«       | j                  d|j                  «       y)zP
        Appending to an empty docstring simply replaces the docstring.
        c                   ó   — y r   r,   r,   r$   r"   ÚnoDocstringzGAppendToDocstringTests.test_appendToEmptyDocstring.<locals>.noDocstring·  rÁ   r$   úAppended text.N©r
   rJ   r+   )r!   rO  s     r"   Útest_appendToEmptyDocstringz2AppendToDocstringTests.test_appendToEmptyDocstring²  s+   € ò
	ô 	˜;Ð(8Ô9Ø×ÑÐ)¨;×+>Ñ+>Õ?r$   c                 óÎ   — d„ }t        |d«       | j                  g d¢|j                  j                  «       «       | j	                  |j                  j                  d«      «       y)aŽ  
        Appending to a single line docstring places the message on a new line,
        with a blank line separating it from the rest of the docstring.

        The docstring ends with a newline, conforming to Twisted and PEP 8
        standards. Unfortunately, the indentation is incorrect, since the
        existing docstring doesn't have enough info to help us indent
        properly.
        c                   ó   — y)ú;This doesn't comply with standards, but is here for a test.Nr,   r,   r$   r"   ÚsingleLineDocstringzTAppendToDocstringTests.test_appendToSingleLineDocstring.<locals>.singleLineDocstringÈ  rí   r$   rP  )rU  r  rP  ú
N)r
   rJ   r+   r/  r×   rÆ   )r!   rV  s     r"   Ú test_appendToSingleLineDocstringz7AppendToDocstringTests.test_appendToSingleLineDocstring½  s]   € ò	Nô 	Ð.Ð0@ÔAØ×Ñòð
  ×'Ñ'×2Ñ2Ó4ô	
ð 	�‰Ð+×3Ñ3×<Ñ<¸TÓBÕCr$   c                 ót   — d„ }d„ }t        |d«       | j                  |j                  |j                  «       y)zþ
        Appending to a multi-line docstring places the messade on a new line,
        with a blank line separating it from the rest of the docstring.

        Because we have multiple lines, we have enough information to do
        indentation.
        c                   ó   — y)z9
            This is a multi-line docstring.
            Nr,   r,   r$   r"   ÚmultiLineDocstringzRAppendToDocstringTests.test_appendToMultilineDocstring.<locals>.multiLineDocstringß  rí   r$   c                   ó   — y)zU
            This is a multi-line docstring.

            Appended text.
            Nr,   r,   r$   r"   ÚexpectedDocstringzQAppendToDocstringTests.test_appendToMultilineDocstring.<locals>.expectedDocstringä  rí   r$   rP  NrQ  )r!   r[  r]  s      r"   Útest_appendToMultilineDocstringz6AppendToDocstringTests.test_appendToMultilineDocstringÖ  s8   € ò	ò
	ô 	Ð-Ð/?Ô@Ø×ÑÐ*×2Ñ2Ð4F×4NÑ4NÕOr$   N)r(   r)   r*   r+   rR  rX  r^  r,   r$   r"   rL  rL  «  s   „ ñò	@òDó2Pr$   rL  c                   óR   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zy)ÚMutualArgumentExclusionTestsz2
    Tests for L{mutuallyExclusiveArguments}.
    c                 ó¤   — t        t        dd«      r t        t        j                  |«      ||«      S t	        t        j
                  |«      ||«      S )aÊ  
        Test an invocation of L{passed} with the given function, arguments, and
        keyword arguments.

        @param func: A function whose argspec will be inspected.
        @type func: A callable.

        @param args: The arguments which could be passed to C{func}.

        @param kw: The keyword arguments which could be passed to C{func}.

        @return: L{_passedSignature} or L{_passedArgSpec}'s return value
        @rtype: L{dict}
        Ú	signatureN)rA   Úinspectr   rb  r   Ú
getargspec©r!   ÚfuncÚargsÚkws       r"   ÚcheckPassedz(MutualArgumentExclusionTests.checkPassedô  sF   € ô ”7˜K¨Ô.ä#¤G×$5Ñ$5°dÓ$;¸TÀ2ÓFÐFô "¤'×"4Ñ"4°TÓ":¸DÀ"ÓEÐEr$   c                 óf   — d„ }| j                  | j                  |dd«      t        dd¬«      «       y)z`
        L{passed} identifies the arguments passed by a simple
        positional test.
        c                  ó   — y r   r,   ©r'  r(  s     r"   rf  zGMutualArgumentExclusionTests.test_passed_simplePositional.<locals>.func  rÁ   r$   rP   rx   rl  N©rJ   ri  r‰   ©r!   rf  s     r"   Útest_passed_simplePositionalz9MutualArgumentExclusionTests.test_passed_simplePositional
  s.   € ò	ð 	×Ñ˜×)Ñ)¨$°°1Ó5´t¸aÀ1´~ÕFr$   c                 óR   — d„ }| j                  t        | j                  |ddd«       y)z[
        L{passed} raises a L{TypeError} if too many arguments are
        passed.
        c                  ó   — y r   r,   rl  s     r"   rf  zBMutualArgumentExclusionTests.test_passed_tooManyArgs.<locals>.func  rÁ   r$   rP   rx   r  N©r?   Ú	TypeErrorri  rn  s     r"   Útest_passed_tooManyArgsz4MutualArgumentExclusionTests.test_passed_tooManyArgs  s'   € ò	ð 	×Ñœ) T×%5Ñ%5°t¸QÀÀ1ÕEr$   c                 óR   — d„ }| j                  t        | j                  |dd¬«       y)zs
        L{passed} raises a L{TypeError} if a argument is passed both
        positionally and by keyword.
        c                  ó   — y r   r,   ©r'  s    r"   rf  zHMutualArgumentExclusionTests.test_passed_doublePassKeyword.<locals>.func&  rÁ   r$   rP   rx   rw  Nrr  rn  s     r"   Útest_passed_doublePassKeywordz:MutualArgumentExclusionTests.test_passed_doublePassKeyword   ó(   € ò	ð 	×Ñœ) T×%5Ñ%5°t¸QÀ!ÐÕDr$   c                 óR   — d„ }| j                  t        | j                  |dd¬«       y)z„
        L{passed} raises a L{TypeError} if a keyword argument not
        present in the function's declaration is passed.
        c                  ó   — y r   r,   rw  s    r"   rf  zIMutualArgumentExclusionTests.test_passed_unspecifiedKeyword.<locals>.func1  rÁ   r$   rP   rx   )ÚzNrr  rn  s     r"   Útest_passed_unspecifiedKeywordz;MutualArgumentExclusionTests.test_passed_unspecifiedKeyword+  ry  r$   c                 óh   — d„ }| j                  | j                  |ddd«      t        dd¬«      «       y)z|
        L{passed} places additional positional arguments into a tuple
        under the name of the star argument.
        c                  ó   — y r   r,   rl  s     r"   rf  z;MutualArgumentExclusionTests.test_passed_star.<locals>.func<  rÁ   r$   rP   rx   r  )rx   r  rl  Nrm  rn  s     r"   Útest_passed_starz-MutualArgumentExclusionTests.test_passed_star6  s1   € ò	ð 	×Ñ˜×)Ñ)¨$°°1°aÓ8¼$ÀÀfÔ:MÕNr$   c                 ó„   — d„ }| j                  | j                  |dddd¬«      t        dt        ddd¬«      ¬«      «       y)	zn
        Additional keyword arguments are passed as a dict to the star star
        keyword argument.
        c                  ó   — y r   r,   rl  s     r"   rf  z?MutualArgumentExclusionTests.test_passed_starStar.<locals>.funcG  rÁ   r$   rP   rx   r  é   )r¯   Úyr|  rl  Nrm  rn  s     r"   Útest_passed_starStarz1MutualArgumentExclusionTests.test_passed_starStarA  sC   € ò	ð 	×ÑØ×Ñ˜T 1¨¨Q°!ÐÓ4´d¸QÄ$ÈÈaÐSTÔBUÔ6Võ	
r$   c                 ón   — dd„}| j                  | j                  |ddd¬«      t        ddd¬«      «       y)	zp
        The results of L{passed} only include arguments explicitly
        passed, not default values.
        rP   rx   c                  ó   — y r   r,   ©r'  r(  r)  ÚdÚes        r"   rf  zFMutualArgumentExclusionTests.test_passed_noDefaultValues.<locals>.funcT  rÁ   r$   é   )rŠ  )r'  r(  rŠ  N©rP   rx   r  rm  rn  s     r"   Útest_passed_noDefaultValuesz8MutualArgumentExclusionTests.test_passed_noDefaultValuesN  s6   € ó	ð 	×Ñ˜×)Ñ)¨$°°1¸Ð)Ó:¼DÀ1ÈÈQÔ<OÕPr$   c                 óÆ   — t        dg«      dd„«       }| j                   |dd«      d«       | j                   |ddd«      d«       | j                   |ddd¬«      d	«       y
)z¥
        L{mutuallyExclusiveArguments} does not interfere in its
        decoratee's operation, either its receipt of arguments or its return
        value.
        rl  c                 ó   — | |z   |z   |z   S r   r,   )r¯   r„  r'  r(  s       r"   rf  zMMutualArgumentExclusionTests.test_mutualExclusionPrimeDirective.<locals>.func`  s   € à�q‘5˜1‘9˜q‘=Ð r$   rP   rx   rD  r‹  é   ©r(  é   N©r  rƒ  )r   rJ   rn  s     r"   Ú"test_mutualExclusionPrimeDirectivez?MutualArgumentExclusionTests.test_mutualExclusionPrimeDirectiveY  se   € ô 
% j \Ó	2ò	!ó 
3ð	!ð 	×Ñ™˜a › RÔ(Ø×Ñ™˜a  A›¨Ô+Ø×Ñ™˜a  aœ¨"Õ-r$   c                 ó`   — t        ddgg«      dd„«       }| j                  t        |dd¬«       y)	z‘
        L{mutuallyExclusiveArguments} raises a L{TypeError}n if its
        decoratee is passed a pair of mutually exclusive arguments.
        r'  r(  r  rƒ  c                 ó   — | |z   S r   r,   rl  s     r"   rf  zPMutualArgumentExclusionTests.test_mutualExclusionExcludesByKeyword.<locals>.funcn  s   € à�q‘5ˆLr$   rl  Nr“  )r   r?   rs  rn  s     r"   Ú%test_mutualExclusionExcludesByKeywordzBMutualArgumentExclusionTests.test_mutualExclusionExcludesByKeywordh  s:   € ô 
% s¨C j \Ó	2ò	ó 
3ð	ð 	×Ñœ) T¨Q°!ÐÕ4r$   c                 ó  —  G d„ d«      } G d„ d«      }d„ } |dd«       t        j                  |«      j                  }|j                  «       } |dd«      |d	<    ||«      }| j	                  t
        t        |d
i «       y)z²
        Create a fake signature with an invalid parameter
        type to test error handling.  The valid parameter
        types are specified in L{inspect.Parameter}.
        c                   ó   — e Zd Zd„ Zy)úMMutualArgumentExclusionTests.test_invalidParameterType.<locals>.FakeSignaturec                 ó   — || _         y r   )Ú
parameters)r!   rœ  s     r"   r#   zVMutualArgumentExclusionTests.test_invalidParameterType.<locals>.FakeSignature.__init__|  s	   € Ø",�•r$   N©r(   r)   r*   r#   r,   r$   r"   ÚFakeSignaturerš  {  s   „ ó-r$   rž  c                   ó   — e Zd Zd„ Zy)úMMutualArgumentExclusionTests.test_invalidParameterType.<locals>.FakeParameterc                 ó    — || _         || _        y r   )ro   Úkind)r!   ro   r¢  s      r"   r#   zVMutualArgumentExclusionTests.test_invalidParameterType.<locals>.FakeParameter.__init__€  s   € Ø �”	Ø �•	r$   Nr�  r,   r$   r"   ÚFakeParameterr     s   „ ó!r$   r£  c                  ó   — y r   r,   rl  s     r"   rf  zDMutualArgumentExclusionTests.test_invalidParameterType.<locals>.func„  rÁ   r$   rP   rx   Úfaker)  ©rP   rx   N)rc  rb  rœ  r˜   r?   rs  r   )r!   rž  r£  rf  rœ  ÚdummyParametersÚfakeSigs          r"   Útest_invalidParameterTypez6MutualArgumentExclusionTests.test_invalidParameterTypet  sz   € ÷	-ñ 	-÷	!ñ 	!ò
	ñ 	ˆQ�Œ
Ü×&Ñ& tÓ,×7Ñ7ˆ
Ø$Ÿ/™/Ó+ˆÙ,¨V°VÓ<ˆ˜ÑÙ Ó0ˆØ×Ñœ)Ô%5°wÀÈÕKr$   N)r(   r)   r*   r+   ri  ro  rt  rx  r}  r€  r…  r�  r”  r—  r©  r,   r$   r"   r`  r`  ï  sF   „ ñòFò,	Gò	Fò	Eò	Eò	Oò
ò	Qò.ò
5óLr$   r`  c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚKeywordOnlyTestsz,
    Keyword only arguments (PEP 3102).
    c                 óB   — t        t        j                  |«      ||«      S )a°  
        Test an invocation of L{passed} with the given function, arguments, and
        keyword arguments.

        @param func: A function whose argspec to pass to L{_passed}.
        @type func: A callable.

        @param args: The arguments which could be passed to L{func}.

        @param kw: The keyword arguments which could be passed to L{func}.

        @return: L{_passed}'s return value
        @rtype: L{dict}
        )r   rc  rb  re  s       r"   ri  zKeywordOnlyTests.checkPassed”  s   € ô  ¤× 1Ñ 1°$Ó 7¸¸rÓBÐBr$   c                 ó–  — ddœd„}ddœd„}| j                  | j                  |ddd«      t        dd¬	«      «       | j                  | j                  |dddd
¬«      t        dd
¬	«      «       | j                  | j                  |ddd
ddd¬«      t        dd
ddd¬«      «       | j                  t        | j                  |ddd
dd¬«       y)z`
        Keyword only arguments follow varargs.
        They are specified in PEP 3102.
        Tr‘  c                  ó   — y)zM
            b is a keyword-only argument, with a default value.
            Nr,   )r(  r'  s     r"   Úfunc1z6KeywordOnlyTests.test_passedKeywordOnly.<locals>.func1«  rí   r$   c                  ó   — y)zd
            b, c, d, e  are keyword-only arguments.
            b has a default value.
            Nr,   )r(  r)  r‰  rŠ  r'  s        r"   Úfunc2z6KeywordOnlyTests.test_passedKeywordOnly.<locals>.func2°  rí   r$   rP   rx   r  rŒ  rl  F)r(  r)  r‰  rŠ  r¦  rˆ  )r(  r)  r‰  N)rJ   ri  r‰   r?   rs  )r!   r¯  r±  s      r"   Útest_passedKeywordOnlyz'KeywordOnlyTests.test_passedKeywordOnly¥  sÕ   € ð ô 	ð
 ô 	ð 	×Ñ˜×)Ñ)¨%°°A°qÓ9¼4À)ÈtÔ;TÔUØ×ÑØ×Ñ˜U A q¨!¨uÐÓ5´t¸iÈ5Ô7Qô	
ð 	×ÑØ×Ñ˜U A q¨E°Q¸!¸qÐÓAÜ�6˜U a¨1°Ô2ô	
ð 	×Ñœ) T×%5Ñ%5°u¸aÀÀeÈqÐTUÐÕVr$   N)r(   r)   r*   r+   ri  r²  r,   r$   r"   r«  r«  �  s   „ ñòCó"Wr$   r«  rŒ  )7r+   rc  r{   r1   rã   Úos.pathr   r   r   Ú	importlibr   ÚImportErrorÚincrementalr   Útwisted.pythonr   Útwisted.python.deprecater	   r
   r   r  r   r   r   r   r   r   r   r   r   Útwisted.python.filepathr   Útwisted.python.runtimer   Útwisted.python.testr   Ú#twisted.python.test.modules_helpersr   Útwisted.trial.unittestr   r   r.   r[   r‚   r²   rì   rï   rñ   r  r  r+  r-  rL  r`  r«  r,   r$   r"   ú<module>r¾     ss  ðñó
 Û 
Û Û Ý ß 1ðÝ+õ  å $÷÷ ÷ ó õ -Ý +Ý 4Ý CÝ 6÷ñ ô"DYÐ*ô DYôN_@Ð2ô _@ôDl%Ð#6Ð8Kô l%ô^c
Ð0ô c
òLòôG
Ð2ô G
ñT ‰G�I˜q ! QÓ'Ó(÷ð ó )ð÷)ñ )ñ0 ™G I¨r°1°aÓ8¸%Ó@òó Aðôh:Ð2ô h:ôVAPÐ0ô APôH]LÐ#6ô ]Lô@/WÐ*õ /Wøð{# ò ØÓðús   ¢D$ Ä$D/Ä.D/