ó
    Ö›‘hé£  ã                   óh  • S r SSKrSSKrSSKrSSKrSSKJr  SSKJrJr   SSK	J
r
  SSKJr  SSKJr  SSKJrJrJrJrJrJrJrJrJrJrJrJr  SS	KJr  SS
K J!r!  SSK"J#r#  SSK$J%r%  SSK&J'r'   " S S5      r( " S S\'5      r) " S S\'5      r* " S S\%\'5      r+ " S S\'5      r,S r-S r. " S S\'5      r/\" \" SSSS5      5       " S  S!5      5       r0 " S" S#5      r1\" \" SS$SS5      S%5      S/S& j5       r2 " S' S(\'5      r3 " S) S*\'5      r4 " S+ S,\'5      r5 " S- S.\'5      r6g! \ a    Sr
 GNf = f)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                   ó$   • \ rS rSrSrS rS rSrg)Ú_MockDeprecatedAttributeé1   ze
Mock of L{twisted.python.deprecate._DeprecatedAttribute}.

@ivar value: The value of the attribute.
c                 ó   • Xl         g ©N©Úvalue©Úselfr    s     ÚfC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/python/test/test_deprecate.pyÚ__init__Ú!_MockDeprecatedAttribute.__init__8   s   € Ø�
ó    c                 ó   • U R                   $ )z
Get a known value.
r   ©r"   s    r#   ÚgetÚ_MockDeprecatedAttribute.get;   s   € ð �z‰zÐr&   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r$   r)   Ú__static_attributes__© r&   r#   r   r   1   s   † ñòõr&   r   c                   ó<   • \ rS rSrSrS rS rS rS rS r	S r
S	rg
)ÚModuleProxyTestséB   zÄ
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                 ó¤   • [         R                  " S5      nUR                  5        H  u  p4[        X#U5        M     [        R
                  " U5      $ )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#   Ú
_makeProxyÚModuleProxyTests._makeProxyI   sA   € ô ×Ò˜uÓ%ˆØŸ+™+ž-‰JˆCÜ�C˜eÖ$ñ (ä×%Ò% cÓ*Ð*r&   c                 ó’   • U R                  SS9nU R                  UR                  S5        U R                  [        [
        US5        g)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)r?   ÚassertIsrC   ÚassertRaisesÚAttributeErrorÚgetattr©r"   Úproxys     r#   Útest_getattrPassthroughÚ(ModuleProxyTests.test_getattrPassthroughV   s=   € ð —‘¨w�Ð7ˆØ�‰�e×*Ñ*¨GÔ4Ø×Ñœ.¬'°5Ð:JÕKr&   c                 ó¤   • U R                  5       n[        R                  US5      n[        S5      US'   U R	                  UR
                  S5        g)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é*   r6   N)r?   ÚobjectÚ__getattribute__r   ÚassertEqualr6   )r"   rJ   rN   s      r#   Útest_getattrInterceptÚ&ModuleProxyTests.test_getattrIntercept`   sH   € ð —‘Ó!ˆÜ &× 7Ñ 7¸Ð?VÓ WÐÜ'?ÀÓ'CÐ˜eÑ$Ø×Ñ˜Ÿ™ BÕ'r&   c                 ó”   • U R                  5       nU R                  [        [        US5        U R                  [        [        US5        g)zx
Private attributes of L{twisted.python.deprecate._ModuleProxy} are
inaccessible when regular attribute access is used.
Ú_modulerN   N)r?   rF   rG   rH   rI   s     r#   Útest_privateAttributesÚ'ModuleProxyTests.test_privateAttributesk   s9   € ð
 —‘Ó!ˆØ×Ñœ.¬'°5¸)ÔDØ×Ñœ.¬'°5Ð:QÕRr&   c                 ó¶   • U R                  5       nSUl        U R                  [        R	                  US5      S5        U R                  UR                  S5        g)zl
Setting attributes on L{twisted.python.deprecate._ModuleProxy} proxies
them through to the wrapped module.
é   rV   N)r?   rV   ÚassertNotEqualrP   rQ   rR   rI   s     r#   Útest_setattrÚModuleProxyTests.test_setattrt   sH   € ð
 —‘Ó!ˆØˆŒØ×ÑœF×3Ñ3°E¸9ÓEÀqÔIØ×Ñ˜Ÿ™¨Õ*r&   c                 ó¼   • U R                  5       n[        R                  US5      nU R                  [	        U5      S[        U5      R                   SU< S35        g)z“
L{twisted.python.deprecated._ModuleProxy.__repr__} produces a string
containing the proxy type and a representation of the wrapped module
object.
rV   Ú<z module=Ú>N)r?   rP   rQ   rR   ÚreprÚtyper+   )r"   rJ   Ú
realModules      r#   Ú	test_reprÚModuleProxyTests.test_repr~   sQ   € ð —‘Ó!ˆÜ×,Ñ,¨U°IÓ>ˆ
Ø×Ñœ˜e›¨¬$¨u«+×*>Ñ*>Ð)?¸xÈ
Á~ÐUVÐ&WÕXr&   r1   N)r+   r,   r-   r.   r/   r?   rK   rS   rW   r\   rd   r0   r1   r&   r#   r3   r3   B   s(   † ñò+òLò	(òSò+õYr&   r3   c                   ó6   • \ rS rSrSrS rS rS rS rS r	Sr
g	)
ÚDeprecatedAttributeTestsé‰   z´
Tests for L{twisted.python.deprecate._DeprecatedAttribute} and
L{twisted.python.deprecate.deprecatedModuleAttribute}, which issue
warnings for deprecated module-level attributes.
c                 ót   • [         R                  U l        [         R                  U l        [        S-   U l        g )Nz.foo)r   ÚversionÚmessager+   Ú_testModuleNamer(   s    r#   ÚsetUpÚDeprecatedAttributeTests.setUp�   s)   € Ü+×3Ñ3ˆŒÜ+×3Ñ3ˆŒÜ'¨&Ñ0ˆÕr&   c                 ó�   • [        [        R                  S-   U-   [        R                  [        S-   [        R
                  -   5      $ )z:
Create the warning string used by deprecated attributes.
Ú.z: )r   r   r+   rj   r	   rk   )r"   Úattrs     r#   Ú_getWarningStringÚ*DeprecatedAttributeTests._getWarningString•   sA   € ô ,Ü ×)Ñ)¨CÑ/°$Ñ6Ü ×(Ñ(Ü&¨Ñ-Ô0D×0LÑ0LÑLó
ð 	
r&   c                 óÒ  ^• Sn[        [        US5        [        R                  " [        XR                  U R
                  5      mU R                  TR                  U5        U4S jnU" 5         U R                  U R                  /5      nU R                  US   S   [        5        U R                  US   S   U R                  U5      5        U R                  [        U5      S5        g)	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_ATTRIBUTErO   c                  ó&   >• T R                  5         g r   )r)   )rq   s   €r#   ÚaddStackLevelÚNDeprecatedAttributeTests.test_deprecatedAttributeHelper.<locals>.addStackLevel¯   s   ø€ Ø�H‰H�Jr&   r   Úcategoryrk   rZ   N)r:   r   r   Ú_DeprecatedAttributerj   rk   rR   r+   ÚflushWarningsÚtest_deprecatedAttributeHelperrE   ÚDeprecationWarningrr   Úlen)r"   Únamerw   ÚwarningsShownrq   s       @r#   r|   Ú7DeprecatedAttributeTests.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                 óª  • [         R                    U R                  U R                  /5      nU R	                  [        U5      S5        Sn[        [         U5        U R                  U R                  /5      nU R	                  [        U5      S5        U R                  US   S   [        5        U R	                  US   S   U R                  U5      5        g)zÝ
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_ATTRIBUTErZ   ry   rk   N)
r   ÚANOTHER_ATTRIBUTEr{   Útest_deprecatedAttributerR   r~   rH   rE   r}   rr   )r"   r€   r   s      r#   r…   Ú1DeprecatedAttributeTests.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                 óx  • [         R                  " S5      =[        R                  U R                  '   nU R                  [        R                  R                  U R                  5        [        USS5        [        USS5        [        R                  " [        SSSS5      S	U R                  S5        [        R                  U R                     nU R                  X!5        [        R                  " [        SSSS5      S	U R                  S5        U R                  U[        R                  U R                     5        g
)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.
r6   ÚfirstrZ   Úsecondé   ÚTwistedé   r   rk   N)r7   r8   ÚsysÚmodulesrl   Ú
addCleanupÚpopr:   r   ÚdeprecatedModuleAttributer   r[   rE   )r"   r=   rJ   s      r#   Útest_wrappedModuleÚ+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Ô'ä×+Ò+Ü�I˜q ! QÓ'¨°D×4HÑ4HÈ(ô	
ð 	�‰�eœSŸ[™[¨×)=Ñ)=Ñ>Õ?r&   )rl   rk   rj   N)r+   r,   r-   r.   r/   rm   rr   r|   r…   r’   r0   r1   r&   r#   rg   rg   ‰   s"   † ñò1ò

ò0ò4Tõ.@r&   rg   c                   ó:   • \ rS rSrSrSrS rS rS rS r	S r
S	rg
)ÚImportedModuleAttributeTestséë   zU
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  ^• U4S jm[        U R                  5       R                  S5      5      nUR                  5         T" X!5      nU R	                  UR
                  R                  S5      /[        R
                  -   5        U R                  [        R                  R                  5       5        U$ )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                 ó,  >• 0 nUR                  5        H|  u  p4U R                  U5      n[        U[        5      (       a  XRU'   UR	                  U5        MB  [        U[
        5      (       a  UR                  5         T" XT5      X#'   Ms  [        S5      e   U$ )Nz(only strings and dicts allowed as values)r9   ÚchildÚ
isinstanceÚbytesÚ
setContentÚdictÚcreateDirectoryÚ
ValueError)ÚpathobjÚdirdictÚpathdictr>   r    r™   ÚmakeSomeFiless         €r#   r£   ÚAImportedModuleAttributeTests.pathEntryTree.<locals>.makeSomeFiles  s‚   ø€ ØˆHØ%Ÿm™mžo‘
�ØŸ™ cÓ*�Ü˜e¤U×+Ñ+Ø$)˜S‘MØ×$Ñ$ UÖ+Ü ¤t×,Ñ,Ø×)Ñ)Ô+Ù$1°%Ó$?�H“Mä$Ð%OÓPÐPñ .ð ˆOr&   úutf-8)r   ÚmktempÚencodeÚmakedirsÚreplaceSysPathÚpathÚdecoder�   ÚreplaceSysModulesrŽ   Úcopy)r"   ÚtreeÚbaseÚresultr£   s       @r#   ÚpathEntryTreeÚ*ImportedModuleAttributeTests.pathEntryTreeù   s�   ø€ õ	ô ˜Ÿ™›×,Ñ,¨WÓ5Ó6ˆØ�‰Œá˜tÓ*ˆà×Ñ˜TŸY™Y×-Ñ-¨gÓ6Ð7¼#¿(¹(ÑBÔCØ×ÑœsŸ{™{×/Ñ/Ó1Ô2Øˆr&   c                 óp   • U R                  SU R                  R                  S5      SS.05      nUS   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#   ÚsimpleModuleEntryÚ.ImportedModuleAttributeTests.simpleModuleEntry  sJ   € ð
 ×"Ñ"àØ$(×$5Ñ$5×$<Ñ$<¸WÓ$EØ"%ñðó
ˆð �ZÑ  Ñ.Ð.r&   c                 óN  • SSK Jn  U R                  [        UR                  R                  S5      5      U5        U R                  U R                  /5      nU R                  [        U5      S5        U R                  US   S   S5        U R                  US   S   [        5        g)	z2
Verification logic for L{test_deprecatedModule}.
r   ©Úmoduler¥   rZ   rk   z7package.module was deprecated in Package 1.2.3: messagery   N)
Úpackager»   rR   r   Ú__file__r§   r{   ÚcheckOneWarningr~   r}   )r"   Ú
modulePathr»   Úemitteds       r#   r¾   Ú,ImportedModuleAttributeTests.checkOneWarning.  s‘   € õ 	#à×Ñœ &§/¡/×"8Ñ"8¸Ó"AÓBÀJÔOØ×$Ñ$ d×&:Ñ&:Ð%;Ó<ˆØ×Ñœ˜W› qÔ)Ø×ÑØ�A‰J�yÑ!ØHô	
ð 	×Ñ˜ ™ JÑ/Ô1CÕDr&   c                 óB   • U R                  U R                  5       5        g)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_deprecatedModuleÚ2ImportedModuleAttributeTests.test_deprecatedModule=  s   € ð 	×Ñ˜T×3Ñ3Ó5Õ6r&   c                 ó®   • U R                  5       nU R                  U5        U R                  U5        [        S5       H  nU R                  U5        M     g)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.
rŠ   N)r·   r¾   Úrange)r"   ÚmpÚxs      r#   Ú"test_deprecatedModuleMultipleTimesÚ?ImportedModuleAttributeTests.test_deprecatedModuleMultipleTimesE  sN   € ð ×#Ñ#Ó%ˆà×Ñ˜RÔ ð 	×Ñ˜RÔ ô �q–ˆAØ× Ñ  Ö$ò r&   r1   N)r+   r,   r-   r.   r/   rµ   r±   r·   r¾   rÃ   rÉ   r0   r1   r&   r#   r•   r•   ë   s)   † ñð
€Lò$òL/òEò7õ%r&   r•   c                   óH   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rSrg)ÚWarnAboutFunctionTestsiZ  z–
Tests for L{twisted.python.deprecate.warnAboutFunction} which allows the
callers of a function to issue a C{DeprecationWarning} about that function.
c                 ó(  ^• [        U R                  5       5      R                  S5      U l        U R                  R	                  5         U R                  R                  S5      R                  S5        U R                  R                  S5      R                  S5        U R                  R                  S5      R                  S5        U R                  R                  5       R                  n[        R                  R                  SU5        U R                  [        R                  R                  U5        [        R                  R                  5       mU R                  U4S	 j5        [        R                  " 5       (       a  U R!                  5         g
g
)zI
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                  ó~   >• [         R                  R                  5       [         R                  R                  T 5      4$ r   )r�   rŽ   ÚclearÚupdate)rŽ   s   €r#   Ú<lambda>Ú.WarnAboutFunctionTests.setUp.<locals>.<lambda>•  s&   ø€ ¤§¡×!2Ñ!2Ó!4´c·k±k×6HÑ6HÈÓ6QÑ Rr&   N)r   r¦   r™   r¼   r¨   rœ   Úparentrª   r�   Úinsertr�   ÚremoverŽ   r­   r   Ú	isWindowsr{   )r"   ÚpackagePathrŽ   s     @r#   rm   Ú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                 ó:  • S n[         R                  " US5        U R                  5       n[        nUR	                  5       R                  S5      (       a  USS nU R                  [        US   S   5      [        U5      5        U R                  US   S   S5        g)	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                  ó   • g r   r1   r1   r&   r#   ÚaFuncÚ2WarnAboutFunctionTests.test_warning.<locals>.aFunc¤  ó   € Ør&   zA Warning Messagez.pycNéÿÿÿÿr   Úfilenamerk   )	r   ÚwarnAboutFunctionr{   r½   ÚlowerÚendswithÚassertSamePathr   rR   )r"   rÜ   r€   rà   s       r#   Útest_warningÚ#WarnAboutFunctionTests.test_warning�  s�   € ò	ô 	×#Ò# EÐ+>Ô?Ø×*Ñ*Ó,ˆÜˆØ�>‰>Ó×$Ñ$ V×,Ñ,Ø  �}ˆHØ×ÑœH ]°1Ñ%5°jÑ%AÓBÄHÈXÓDVÔWØ×Ñ˜ qÑ)¨)Ñ4Ð6IÕJr&   c                 ó–  • SSK Jn  UR                  5         U R                  5       nU R	                  [        US   S   R                  S5      5      U R                  R                  S5      R                  S5      5        U R                  US   S   S5        U R                  US   S	   S
5        U R                  [        U5      S5        g)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é	   rk   úA Warning StringrZ   N)rÎ   r»   ÚcallTestFunctionr{   rä   r   r§   r¼   Úsiblingr™   rR   r~   ©r"   r»   r€   s      r#   Útest_warningLineNumberÚ-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                 ó–  • SSK Jn  UR                  5         U R                  5       nU R	                  [        US   S   R                  S5      5      U R                  R                  S5      R                  S5      5        U R                  US   S   S5        U R                  US   S	   S
5        U R                  [        U5      S5        g)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é   é   rk   rë   rZ   N)rÎ   rò   rì   r{   rä   r   r§   r¼   rí   r™   rR   r~   )r"   rò   r€   s      r#   Ú'test_warningLineNumberDisFindlinestartsÚ>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                 óˆ   • U R                  [        UR                  5      [        UR                  5      :H  U< SU< 35        g)zÞ
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"   rˆ   r‰   s      r#   rä   Ú%WarnAboutFunctionTests.assertSamePathÖ  s8   € ð 	�‰Ü�U—Z‘ZÓ ¤H¨V¯[©[Ó$9Ñ9Ø‰i�t˜F™:Ð&õ	
r&   c                 óf  • SSK Jn  [        R                  S	 [        R                  UR                  	 U R
                  R                  U R
                  R                  S5      5        [        (       a
  [        5         SSK	Jn  U R                  [        R                  R                  S5        U R                  [        R                  R                  UR                  5        UR                  5         U R                  UR                  /5      n[        US   S   R!                  S5      5      nU R
                  R                  S5      R#                  S5      nU R%                  X45        U R'                  US   S	   S
5        U R'                  US   S   S5        U R'                  [)        U5      S5        g)zä
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ê   rk   rë   rZ   N)rÎ   r»   r�   rŽ   r+   r¼   ÚmoveTorí   r   rú   r�   r�   rì   r{   ÚtestFunctionr   r§   r™   rä   rR   r~   )r"   r»   r€   Ú
warnedPathÚexpectedPaths        r#   Útest_renamedFileÚ'WarnAboutFunctionTests.test_renamedFileå  sO  € õ 	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                 óÖ   • [         R                  SS2	 [         R                  " SSS9  SSKJn  UR                  5         U R                  5       nU R                  [        U5      S5        g)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ì   r{   rR   r~   rî   s      r#   Útest_filteredWarningÚ+WarnAboutFunctionTests.test_filteredWarning  sU   € ô ×ÑšQÐä×Ò xÐ8PÒQå1à×ÑÔ!à×*Ñ*Ó,ˆØ×Ñœ˜]Ó+¨QÕ/r&   c                 ó®  • [         R                  SS2	 [         R                  " SSS9  SSKJn  UR                  5         UR                  5         U R                  5       nU R                  [        U5      S5        US   S   nUS   S	   nUS   S
   nUS   S   n[         R                  " X4XV5      nU R                  UR                  S5      SU< 35        g)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º   rZ   rk   ry   rà   ré   z=module.py:9: DeprecationWarning: A Warning String
  return a
zUnexpected warning string: )r  r  r  rÎ   r»   rì   r{   rR   r~   Úformatwarningr÷   rã   )r"   r»   r€   rk   ry   rà   ré   Úmsgs           r#   Útest_filteredOnceWarningÚ/WarnAboutFunctionTests.test_filteredOnceWarning  sÖ   € ô ×ÑšQÐä×Ò xÐ8PÒQå1à×ÑÔ!Ø×ÑÔ!à×*Ñ*Ó,ˆØ×Ñœ˜]Ó+¨QÔ/Ø Ñ" 9Ñ-ˆØ  Ñ# JÑ/ˆØ  Ñ# JÑ/ˆØ˜qÑ! (Ñ+ˆÜ×$Ò$ W¸ÓIˆØ�‰Ø�L‰LØTóð *¨#©Ð1õ		
r&   )r¼   N)r+   r,   r-   r.   r/   rm   rå   rï   rô   rä   rÿ   r  r  r0   r1   r&   r#   rÌ   rÌ   Z  s2   † ñò
;!òzKò$0ò&0ò(
ò$0òL0õ(
r&   rÌ   c                  ó   • g©z?
Do nothing.

This is used to test the deprecation decorators.
Nr1   r1   r&   r#   ÚdummyCallabler  @  ó   � r&   c                  ó   • g)zO
Do nothing.

This is used to test the replacement parameter to L{deprecated}.
Nr1   r1   r&   r#   ÚdummyReplacementMethodr  H  r  r&   c                   óJ   • \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rSrg)ÚDeprecationWarningsTestsiP  c                 ó|   • [        SSSS5      nU R                  [        U R                  U5      [        < S35        g)zˆ
L{getDeprecationWarningString} returns a string that tells us that a
callable was deprecated at a certain released version of Twisted.
r‹   rŒ   r   zZ.DeprecationWarningsTests.test_getDeprecationWarningString was deprecated in Twisted 8.0.0N)r   rR   r   Ú test_getDeprecationWarningStringr+   ©r"   rj   s     r#   r  Ú9DeprecationWarningsTests.test_getDeprecationWarningStringQ  s:   € ô
 ˜) Q¨¨1Ó-ˆØ×ÑÜ'¨×(MÑ(MÈwÓWç19ð<õ	
r&   c                 óŽ   • [        SSSS5      n[        S-   nU R                  [        U R                  X5      [
        < S35        g)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.
r‹   rŒ   r   z: This is a messagezm.DeprecationWarningsTests.test_getDeprecationWarningString was deprecated in Twisted 8.0.0: This is a messageN)r   r	   rR   r   r  r+   )r"   rj   Úformats      r#   Ú*test_getDeprecationWarningStringWithFormatÚCDeprecationWarningsTests.test_getDeprecationWarningStringWithFormat]  sM   € ô ˜) Q¨¨1Ó-ˆÜ+Ð.CÑCˆØ×ÑÜ'Ø×5Ñ5°wó÷ AIðKõ		
r&   c                 óö  ^• [        SSSS5      n[        U5      " [        5      mU4S jn[        SS9 n[	        S5        U" 5         U R                  US   R                  [        5        U R                  [        US   R                  5      [        [        U5      5        U R                  US   R                  R                  S5      [        R                  S5      5        S	S	S	5        g	! , (       d  f       g	= f)
z;
Decorating a callable with L{deprecated} emits a warning.
r‹   rŒ   r   c                  ó   >• T " 5         g r   r1   )Údummys   €r#   rw   ÚJDeprecationWarningsTests.test_deprecateEmitsWarning.<locals>.addStackLevelt  s   ø€ Ù�Gr&   T©ÚrecordÚalwaysÚcoN)r   r   r  r   r   rR   ry   r}   Ústrrk   r   rà   Úrstripr½   )r"   rj   rw   Úcaughtr!  s       @r#   Útest_deprecateEmitsWarningÚ3DeprecationWarningsTests.test_deprecateEmitsWarningm  sÃ   ø€ ô ˜) Q¨¨1Ó-ˆÜ˜7Ô#¤MÓ2ˆõ	ô  4Ò(¨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÷ )×(Ö(ús   ´B-C*Ã*
C8c                 óî   • [        SSSS5      n[        U5      " [        5      nU R                  [        R                  UR                  5        U R                  [        [        5      [        U5      5        g)z;
The decorated function has the same name as the original.
r‹   rŒ   r   N)r   r   r  rR   r+   ÚfullyQualifiedName©r"   rj   r!  s      r#   Útest_deprecatedPreservesNameÚ5DeprecationWarningsTests.test_deprecatedPreservesName‚  sY   € ô ˜) Q¨¨1Ó-ˆÜ˜7Ô#¤MÓ2ˆØ×Ñœ×/Ñ/°·±Ô@Ø×ÑÔ+¬MÓ:Ô<NÈuÓ<UÕVr&   c                 óX   • [        SSSS5      nU R                  S[        US5      5        g)zZ
L{_getDeprecationDocstring} returns a note about the deprecation to go
into a docstring.
r‹   rŒ   r   zDeprecated in Twisted 8.0.0.Ú N)r   rR   r   r  s     r#   Útest_getDeprecationDocstringÚ5DeprecationWarningsTests.test_getDeprecationDocstring‹  s/   € ô
 ˜) Q¨¨1Ó-ˆØ×ÑØ*Ô,DÀWÈbÓ,Qõ	
r&   c                 óÀ   • S n[        SSSS5      n[        U5      " U5      n[        U[        US5      5        U R	                  UR
                  UR
                  5        g)z^
The docstring of the deprecated function is appended with information
about the deprecation.
c                  ó   • gr  r1   r1   r&   r#   ÚlocalDummyCallableÚTDeprecationWarningsTests.test_deprecatedUpdatesDocstring.<locals>.localDummyCallable›  r  r&   r‹   rŒ   r   r2  N)r   r   r
   r   rR   r/   )r"   r7  rj   r!  s       r#   Útest_deprecatedUpdatesDocstringÚ8DeprecationWarningsTests.test_deprecatedUpdatesDocstring•  sX   € ò	ô ˜) Q¨¨1Ó-ˆÜ˜7Ô#Ð$6Ó7ˆäÐ-Ô/GÈÐQSÓ/TÔUà×ÑÐ+×3Ñ3°U·]±]ÕCr&   c                 ó€   • [        SSSS5      n[        U5      " [        5      nU R                  XR                  5        g)z\
Deprecating a function adds version information to the decorated
version of that function.
r‹   rŒ   r   N)r   r   r  rR   ÚdeprecatedVersionr.  s      r#   Útest_versionMetadataÚ-DeprecationWarningsTests.test_versionMetadata©  s7   € ô
 ˜) Q¨¨1Ó-ˆÜ˜7Ô#¤MÓ2ˆØ×Ñ˜×"9Ñ"9Õ:r&   c                 óœ   • [        SSSS5      n[        U R                  USS9nU R                  U[	        U R                  5      < S35        g)zß
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.
r‹   rŒ   r   úsomething.foobar©ÚreplacementzE was deprecated in Twisted 8.0.0; please use something.foobar insteadN)r   r   r  rR   r-  ©r"   rj   ÚwarningStrings      r#   Ú+test_getDeprecationWarningStringReplacementÚDDeprecationWarningsTests.test_getDeprecationWarningStringReplacement²  sT   € ô ˜) Q¨¨1Ó-ˆÜ3Ø×1Ñ1ØØ*ñ
ˆð
 	×ÑØä+¨D×,QÑ,QÖRðUõ	
r&   c                 ó´   • [        SSSS5      n[        U R                  U[        S9nU R	                  U[        U R                  5      < S[        < S35        g)zí
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.
r‹   rŒ   r   rA  z- was deprecated in Twisted 8.0.0; please use z.dummyReplacementMethod insteadN)r   r   r  r  rR   r-  r+   rC  s      r#   Ú7test_getDeprecationWarningStringReplacementWithCallableÚPDeprecationWarningsTests.test_getDeprecationWarningStringReplacementWithCallableÅ  sX   € ô ˜) Q¨¨1Ó-ˆÜ3Ø×1Ñ1ØÜ.ñ
ˆð
 	×ÑØô " $×"GÑ"GÖHÏ(ðTõ	
r&   r1   N)r+   r,   r-   r.   r  r  r*  r/  r3  r9  r=  rE  rH  r0   r1   r&   r#   r  r  P  s2   † ò

ò
ò Uò*Wò
òDò(;ò
õ&
r&   r  r‹   rZ   rŠ   é   c                   ó   • \ rS rSrSrSrg)ÚDeprecatedClassiÚ  zB
Class which is entirely deprecated without having a replacement.
r1   N)r+   r,   r-   r.   r/   r0   r1   r&   r#   rL  rL  Ú  s   † ôr&   rL  c                   ón   • \ rS rSrSrSr\" \" SSSS5      5      S 5       r\R                  S	 5       rS
r
g)ÚClassWithDeprecatedPropertyiá  z*
Class with a single deprecated property.
Nr‹   rZ   rŠ   rJ  c                 ó   • U R                   $ )z+
Getter docstring.

@return: The property.
©Ú_someProtectedValuer(   s    r#   ÚsomePropertyÚ(ClassWithDeprecatedProperty.somePropertyè  s   € ð ×'Ñ'Ð'r&   c                 ó   • Xl         g)z
Setter docstring.
NrP  r!   s     r#   rR  rS  ñ  s
   € ð
 $)Õ r&   rP  )r+   r,   r-   r.   r/   rQ  r   r   rR  Úsetterr0   r1   r&   r#   rN  rN  á  sK   † ñð Ðá™ 	¨1¨a°Ó3Ó4ñ(ó 5ð(ð ×Ññ)ó ó)r&   rN  é   r6   c                 ó   • g)z/
Function with a deprecated keyword parameter.
Nr1   )ÚaÚbÚcr6   Úbars        r#   ÚfunctionWithDeprecatedParameterr\  ù  r  r&   c                   óB   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
rg)ÚDeprecatedDecoratorTestsi   z"
Tests for deprecated decorators.
c                 óÊ   • U R                  X!R                  R                  5        Vs/ s H)  o3R                  5       (       d  M  UR                  5       PM+     sn5        gs  snf )a   
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)rR   r/   Ú
splitlinesÚstrip)r"   ÚtargetÚexpectedrÈ   s       r#   ÚassertDocstringÚ(DeprecatedDecoratorTests.assertDocstring  sD   € ð 	×ÑØ¯.©.×*CÑ*CÔ*EÓSÒ*E QÏÉÏ“y�q—w‘w–yÑ*EÑSõ	
ùÚSs   ¨A 
ÁA 
c                 óŽ  • [        5       nUR                    U R                  [         R                  / SQ5        [        SSSS5      [         R                  l        SnU R                  U R                  /5      nU R                  S[        U5      5        U R                  [        US   S   5        U R                  X#S   S	   5        g
)zý
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.r‹   rZ   rŠ   rJ  úktwisted.python.test.test_deprecate.ClassWithDeprecatedProperty.someProperty was deprecated in Twisted 1.2.3r   ry   rk   N)
rN  rR  rd  r   r<  r{   Útest_propertyGetterrR   r~   r}   )r"   Úobjrk   r  s       r#   ri  Ú,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                 óF  • [        5       n[        5       nXl        U R                  XR                  5        SnU R                  U R                  /5      nU R                  S[        U5      5        U R                  [        US   S   5        U R                  X4S   S   5        g)ze
When L{deprecatedProperty} is used on a C{property}, setter accesses
raise a L{DeprecationWarning}.
rh  rZ   r   ry   rk   N)
rP   rN  rR  rE   rQ  r{   Útest_propertySetterrR   r~   r}   )r"   ÚnewValuerj  rk   r  s        r#   rm  Ú,DeprecatedDecoratorTests.test_propertySetter4  s•   € ô
 “8ˆÜ)Ó+ˆà#Ôà�‰�h× 7Ñ 7Ô8ð;ð 	ð ×%Ñ% t×'?Ñ'?Ð&@ÓAˆØ×Ñ˜œC ›MÔ*Ø×ÑÔ+¨X°a©[¸Ñ-DÔEØ×Ñ˜¨1¡+¨iÑ"8Õ9r&   c                 óN  • [        5         U R                  [         SS/5        [        SSSS5      [         l        SnU R	                  U R
                  /5      nU R                  S[        U5      5        U R                  [        US   S	   5        U R                  XS   S
   5        g)zö
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.rg  r‹   rZ   rŠ   rJ  zRtwisted.python.test.test_deprecate.DeprecatedClass was deprecated in Twisted 1.2.3r   ry   rk   N)	rL  rd  r   r<  r{   Ú
test_classrR   r~   r}   )r"   rk   r  s      r#   rq  Ú#DeprecatedDecoratorTests.test_classH  s£   € ô 	Ôà×ÑÜàVØ.ðô	
ô -4°I¸qÀ!ÀQÓ,GŒÔ)ð.ð 	ð ×%Ñ% t§¡Ð&7Ó8ˆØ×Ñ˜œC ›MÔ*Ø×ÑÔ+¨X°a©[¸Ñ-DÔEØ×Ñ˜¨1¡+¨iÑ"8Õ9r&   c                 ó„   • [        SSSS5      n[        US5      " [        5      nU R                  UR                  S5        g)zò
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.
r‹   rŒ   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  rR   r/   r.  s      r#   Útest_deprecatedReplacementÚ3DeprecatedDecoratorTests.test_deprecatedReplacementc  s@   € ô ˜) Q¨¨1Ó-ˆÜ˜7Ð$6Ô7¼ÓFˆØ×ÑØ�M‰Mðõ	
r&   c                 ó²   • [        SSSS5      n[        U[        S9nU" [        5      nU R	                  UR
                  SR                  [        5      5        g)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.
r‹   rŒ   r   rA  z‹
Do nothing.

This is used to test the deprecation decorators.

Deprecated in Twisted 8.0.0; please use {}.dummyReplacementMethod instead.
N)r   r   r  r  rR   r/   r  r+   )r"   rj   Ú	decoratorr!  s       r#   Ú&test_deprecatedReplacementWithCallableÚ?DeprecatedDecoratorTests.test_deprecatedReplacementWithCallablev  sQ   € ô ˜) Q¨¨1Ó-ˆÜ˜wÔ4JÑKˆ	Ùœ-Ó(ˆØ×ÑØ�M‰Mð3÷ 4:±6¼(Ó3Cõ	
r&   c                 ó  • Sn[        SS9 n[        S5        [        SS5        U R                  U/ 5        [        SSS5        U R                  U/ 5        [        SSSS	9  U R                  [	        U5      S
5        U R                  US   R
                  [        5        U R                  [        US   R                  5      U5        UR                  5         [        SSSS9  U R                  U/ 5        [        SSSS5        U R                  [	        U5      S
5        U R                  US   R
                  [        5        U R                  [        US   R                  5      U5        S S S 5        g ! , (       d  f       g = f)NzzThe 'foo' parameter to twisted.python.test.test_deprecate.functionWithDeprecatedParameter was deprecated in Twisted 19.2.0Tr#  r%  é
   é   é   é(   )r6   rZ   r   é2   )r[  )
r   r   r\  rR   r~   ry   r}   r'  rk   rÐ   )r"   rk   Úwss      r#   Útest_deprecatedKeywordParameterÚ8DeprecatedDecoratorTests.test_deprecatedKeywordParameter‰  s5  € ð/ð 	ô  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E0Å0
E>r1   N)r+   r,   r-   r.   r/   rd  ri  rm  rq  rt  rx  r�  r0   r1   r&   r#   r^  r^     s+   † ñò
ò:ò@:ò(:ò6
ò&
õ&:r&   r^  c                   ó*   • \ rS rSrSrS rS rS rSrg)ÚAppendToDocstringTestsi©  z_
Test the _appendToDocstring function.

_appendToDocstring is used to add text to a docstring.
c                 óZ   • S n[        US5        U R                  SUR                  5        g)z@
Appending to an empty docstring simply replaces the docstring.
c                  ó   • g r   r1   r1   r&   r#   ÚnoDocstringÚGAppendToDocstringTests.test_appendToEmptyDocstring.<locals>.noDocstringµ  rÞ   r&   úAppended text.N©r
   rR   r/   )r"   r‡  s     r#   Útest_appendToEmptyDocstringÚ2AppendToDocstringTests.test_appendToEmptyDocstring°  s+   € ò
	ô 	˜;Ð(8Ô9Ø×ÑÐ)¨;×+>Ñ+>Õ?r&   c                 óÎ   • S n[        US5        U R                  / SQUR                  R                  5       5        U R	                  UR                  R                  S5      5        g)aV  
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                  ó   • g)ú;This doesn't comply with standards, but is here for a test.Nr1   r1   r&   r#   ÚsingleLineDocstringÚTAppendToDocstringTests.test_appendToSingleLineDocstring.<locals>.singleLineDocstringÆ  r  r&   r‰  )r�  r2  r‰  Ú
N)r
   rR   r/   r`  r÷   rã   )r"   r�  s     r#   Ú test_appendToSingleLineDocstringÚ7AppendToDocstringTests.test_appendToSingleLineDocstring»  s]   € ò	Nô 	Ð.Ð0@ÔAØ×Ñòð
  ×'Ñ'×2Ñ2Ó4ô	
ð 	�‰Ð+×3Ñ3×<Ñ<¸TÓBÕCr&   c                 óZ   • S n[        US5        U R                  SUR                  5        g)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                  ó   • g)z!
This is a multi-line docstring.
Nr1   r1   r&   r#   ÚmultiLineDocstringÚRAppendToDocstringTests.test_appendToMultilineDocstring.<locals>.multiLineDocstringÝ  r  r&   r‰  z1
This is a multi-line docstring.

Appended text.
NrŠ  )r"   r—  s     r#   Útest_appendToMultilineDocstringÚ6AppendToDocstringTests.test_appendToMultilineDocstringÔ  s/   € ò	ô
 	Ð-Ð/?Ô@Ø×ÑØLØ×&Ñ&õ	
r&   r1   N)	r+   r,   r-   r.   r/   r‹  r“  r™  r0   r1   r&   r#   r„  r„  ©  s   † ñò	@òDõ2
r&   r„  c                   óZ   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rS rSrg)ÚMutualArgumentExclusionTestsié  z*
Tests for L{mutuallyExclusiveArguments}.
c                 ó®   • [        [        SS5      (       a   [        [        R                  " U5      X#5      $ [	        [        R
                  " U5      X#5      $ )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)rH   Úinspectr   rž  r   Ú
getargspec©r"   ÚfuncÚargsÚkws       r#   ÚcheckPassedÚ(MutualArgumentExclusionTests.checkPassedî  sE   € ô ”7˜K¨×.Ñ.ä#¤G×$5Ò$5°dÓ$;¸TÓFÐFô "¤'×"4Ò"4°TÓ":¸DÓEÐEr&   c                 ó`   • S nU R                  U R                  USS5      [        SSS95        g)zH
L{passed} identifies the arguments passed by a simple
positional test.
c                 ó   • g r   r1   ©rX  rY  s     r#   r¢  ÚGMutualArgumentExclusionTests.test_passed_simplePositional.<locals>.func
  rÞ   r&   rZ   rŠ   r©  N©rR   r¥  r�   ©r"   r¢  s     r#   Útest_passed_simplePositionalÚ9MutualArgumentExclusionTests.test_passed_simplePositional  s.   € ò	ð 	×Ñ˜×)Ñ)¨$°°1Ó5´t¸aÀ1±~ÕFr&   c                 óR   • S nU R                  [        U R                  USSS5        g)zC
L{passed} raises a L{TypeError} if too many arguments are
passed.
c                 ó   • g r   r1   r©  s     r#   r¢  ÚBMutualArgumentExclusionTests.test_passed_tooManyArgs.<locals>.func  rÞ   r&   rZ   rŠ   rJ  N©rF   Ú	TypeErrorr¥  r¬  s     r#   Útest_passed_tooManyArgsÚ4MutualArgumentExclusionTests.test_passed_tooManyArgs  s'   € ò	ð 	×Ñœ) T×%5Ñ%5°t¸QÀÀ1ÕEr&   c                 óL   • S nU R                  [        U R                  USSS9  g)z[
L{passed} raises a L{TypeError} if a argument is passed both
positionally and by keyword.
c                 ó   • g r   r1   ©rX  s    r#   r¢  ÚHMutualArgumentExclusionTests.test_passed_doublePassKeyword.<locals>.func   rÞ   r&   rZ   rŠ   r¸  Nr²  r¬  s     r#   Útest_passed_doublePassKeywordÚ:MutualArgumentExclusionTests.test_passed_doublePassKeyword  ó(   € ò	ð 	×Ñœ) T×%5Ñ%5°t¸QÀ!ÐÒDr&   c                 óL   • S nU R                  [        U R                  USSS9  g)zl
L{passed} raises a L{TypeError} if a keyword argument not
present in the function's declaration is passed.
c                 ó   • g r   r1   r¸  s    r#   r¢  ÚIMutualArgumentExclusionTests.test_passed_unspecifiedKeyword.<locals>.func+  rÞ   r&   rZ   rŠ   )ÚzNr²  r¬  s     r#   Útest_passed_unspecifiedKeywordÚ;MutualArgumentExclusionTests.test_passed_unspecifiedKeyword%  r¼  r&   c                 ób   • S nU R                  U R                  USSS5      [        SSS95        g)zd
L{passed} places additional positional arguments into a tuple
under the name of the star argument.
c                 ó   • g r   r1   r©  s     r#   r¢  Ú;MutualArgumentExclusionTests.test_passed_star.<locals>.func6  rÞ   r&   rZ   rŠ   rJ  )rŠ   rJ  r©  Nr«  r¬  s     r#   Útest_passed_starÚ-MutualArgumentExclusionTests.test_passed_star0  s1   € ò	ð 	×Ñ˜×)Ñ)¨$°°1°aÓ8¼$ÀÀfÑ:MÕNr&   c                 ór   • S nU R                  U R                  USSSSS9[        S[        SSSS9S95        g)	zV
Additional keyword arguments are passed as a dict to the star star
keyword argument.
c                 ó   • g r   r1   r©  s     r#   r¢  Ú?MutualArgumentExclusionTests.test_passed_starStar.<locals>.funcA  rÞ   r&   rZ   rŠ   rJ  é   )rÈ   ÚyrÀ  r©  Nr«  r¬  s     r#   Útest_passed_starStarÚ1MutualArgumentExclusionTests.test_passed_starStar;  sC   € ò	ð 	×ÑØ×Ñ˜T 1¨¨Q°!ÐÐ4´d¸QÄ$ÈÈaÐSTÑBUÑ6Võ	
r&   c           	      ód   • SS jnU R                  U R                  USSSS9[        SSSS95        g)	zX
The results of L{passed} only include arguments explicitly
passed, not default values.
rZ   rŠ   c                 ó   • g r   r1   ©rX  rY  rZ  ÚdÚes        r#   r¢  ÚFMutualArgumentExclusionTests.test_passed_noDefaultValues.<locals>.funcN  rÞ   r&   é   )rÓ  )rX  rY  rÓ  N©rZ   rŠ   rJ  r«  r¬  s     r#   Útest_passed_noDefaultValuesÚ8MutualArgumentExclusionTests.test_passed_noDefaultValuesH  s6   € ô	ð 	×Ñ˜×)Ñ)¨$°°1¸Ð)Ð:¼DÀ1ÈÈQÑ<OÕPr&   c                 óÂ   • [        S/5      SS j5       nU R                  U" SS5      S5        U R                  U" SSS5      S5        U R                  U" SSSS9S	5        g
)z…
L{mutuallyExclusiveArguments} does not interfere in its
decoratee's operation, either its receipt of arguments or its return
value.
r©  c                 ó   • X-   U-   U-   $ r   r1   )rÈ   rÌ  rX  rY  s       r#   r¢  ÚMMutualArgumentExclusionTests.test_mutualExclusionPrimeDirective.<locals>.funcZ  s   € à‘5˜1‘9˜q‘=Ð r&   rZ   rŠ   r{  rÕ  é   ©rY  é   N©rJ  rË  )r   rR   r¬  s     r#   Ú"test_mutualExclusionPrimeDirectiveÚ?MutualArgumentExclusionTests.test_mutualExclusionPrimeDirectiveS  se   € ô 
% j \Ó	2ó	!ó 
3ð	!ð 	×Ñ™˜a › RÔ(Ø×Ñ™˜a  A›¨Ô+Ø×Ñ™˜a  a™¨"Õ-r&   c                 ó\   • [        SS//5      SS j5       nU R                  [        USSS9  g)	zy
L{mutuallyExclusiveArguments} raises a L{TypeError}n if its
decoratee is passed a pair of mutually exclusive arguments.
rX  rY  rJ  rË  c                 ó
   • X-   $ r   r1   r©  s     r#   r¢  ÚPMutualArgumentExclusionTests.test_mutualExclusionExcludesByKeyword.<locals>.funch  s	   € à‘5ˆLr&   r©  Nrß  )r   rF   r³  r¬  s     r#   Ú%test_mutualExclusionExcludesByKeywordÚBMutualArgumentExclusionTests.test_mutualExclusionExcludesByKeywordb  s:   € ô 
% s¨C j \Ó	2ó	ó 
3ð	ð 	×Ñœ) T¨Q°!ÐÒ4r&   c                 ó  •  " S S5      n " S S5      nS nU" SS5        [         R                  " U5      R                  nUR                  5       nU" SS5      US	'   U" U5      nU R	                  [
        [        US
0 5        g)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                   ó   • \ rS rSrS rSrg)ÚMMutualArgumentExclusionTests.test_invalidParameterType.<locals>.FakeSignatureiu  c                 ó   • Xl         g r   ©Ú
parameters)r"   rì  s     r#   r$   ÚVMutualArgumentExclusionTests.test_invalidParameterType.<locals>.FakeSignature.__init__v  s   € Ø",•r&   rë  N©r+   r,   r-   r.   r$   r0   r1   r&   r#   ÚFakeSignatureré  u  s   † õ-r&   rï  c                   ó   • \ rS rSrS rSrg)ÚMMutualArgumentExclusionTests.test_invalidParameterType.<locals>.FakeParameteriy  c                 ó   • Xl         X l        g r   )r   Úkind)r"   r   ró  s      r#   r$   ÚVMutualArgumentExclusionTests.test_invalidParameterType.<locals>.FakeParameter.__init__z  s   € Ø ”	Ø •	r&   )ró  r   Nrî  r1   r&   r#   ÚFakeParameterrñ  y  s   † õ!r&   rõ  c                 ó   • g r   r1   r©  s     r#   r¢  ÚDMutualArgumentExclusionTests.test_invalidParameterType.<locals>.func~  rÞ   r&   rZ   rŠ   ÚfakerZ  ©rZ   rŠ   N)rŸ  rž  rì  r­   rF   r³  r   )r"   rï  rõ  r¢  rì  ÚdummyParametersÚfakeSigs          r#   Útest_invalidParameterTypeÚ6MutualArgumentExclusionTests.test_invalidParameterTypen  sz   € ÷	-ñ 	-÷	!ñ 	!ò
	ñ 	ˆQ�Œ
Ü×&Ò& tÓ,×7Ñ7ˆ
Ø$Ÿ/™/Ó+ˆÙ,¨V°VÓ<ˆ˜ÑÙ Ó0ˆØ×Ñœ)Ô%5°wÀÈÕKr&   r1   N)r+   r,   r-   r.   r/   r¥  r­  r´  rº  rÁ  rÆ  rÍ  r×  rà  rå  rü  r0   r1   r&   r#   rœ  rœ  é  sF   † ñòFò,	Gò	Fò	Eò	Eò	Oò
ò	Qò.ò
5õLr&   rœ  c                   ó$   • \ rS rSrSrS rS rSrg)ÚKeywordOnlyTestsi‰  z$
Keyword only arguments (PEP 3102).
c                 óB   • [        [        R                  " U5      X#5      $ )ah  
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   rŸ  rž  r¡  s       r#   r¥  ÚKeywordOnlyTests.checkPassedŽ  s   € ô  ¤× 1Ò 1°$Ó 7¸ÓBÐBr&   c                 óv  • SS.S jnSS.S jnU R                  U R                  USSS5      [        SSS	95        U R                  U R                  USSSS
S9[        SS
S	95        U R                  U R                  USSS
SSSS9[        SS
SSSS95        U R                  [        U R                  USSS
SSS9  g)zH
Keyword only arguments follow varargs.
They are specified in PEP 3102.
TrÝ  c                 ó   • g)z5
b is a keyword-only argument, with a default value.
Nr1   )rY  rX  s     r#   Úfunc1Ú6KeywordOnlyTests.test_passedKeywordOnly.<locals>.func1¥  r  r&   c                 ó   • g)z@
b, c, d, e  are keyword-only arguments.
b has a default value.
Nr1   )rY  rZ  rÒ  rÓ  rX  s        r#   Úfunc2Ú6KeywordOnlyTests.test_passedKeywordOnly.<locals>.func2ª  r  r&   rZ   rŠ   rJ  rÖ  r©  F)rY  rZ  rÒ  rÓ  rù  rÑ  )rY  rZ  rÒ  N)rR   r¥  r�   rF   r³  )r"   r  r  s      r#   Útest_passedKeywordOnlyÚ'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&   r1   N)r+   r,   r-   r.   r/   r¥  r	  r0   r1   r&   r#   rÿ  rÿ  ‰  s   † ñòCõ"Wr&   rÿ  rÖ  )7r/   rŸ  r�   r7   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   r3   rg   r•   rÌ   r  r  r  rL  rN  r\  r^  r„  rœ  rÿ  r1   r&   r#   Ú<module>r     so  ðñó
 Û 
Û Û Ý ß 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ðôf:Ð2ô f:ôR=
Ð0ô =
ô@]LÐ#6ô ]Lô@/WÐ*õ /Wøðo# ó ØÓðús   ¢D% Ä%D1Ä0D1