%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/test/__pycache__/test_plugin.cpython-312.pyc

�

Ϫ�fh����dZddlmZddlZddlZddlZddlZddlZddlZddl	m
Zddlm
Z
ddlmZmZmZddlmZddlmZdd	lmZdd
lmZmZmZmZddlmZed�ZGd
�de�Z Gd�de�Z!Gd�dejD�Z#dZ$dd�Z%										dd�Z&Gd�de�Z'Gd�dejD�Z(Gd�dejD�Z)Gd�dejD�Z*y) z"
Tests for Twisted plugin system.
�)�annotationsN)�invalidate_caches)�
ModuleType)�Callable�	TypedDict�TypeVar)�	Interface)�plugin)�FilePath)�	EventDict�addObserver�removeObserver�textFromEventDict)�unittest�_Tc��eZdZdZy)�ITestPluginzS
    A plugin for use by the plugin system's unit tests.

    Do not use this.
    N��__name__�
__module__�__qualname__�__doc__���:/usr/lib/python3/dist-packages/twisted/test/test_plugin.pyrrs��rrc��eZdZdZy)�ITestPlugin2z
    See L{ITestPlugin}.
    Nrrrrrr&s��rrc���eZdZdZdd�Zdd�Z	d					dd�Zdd�Z				dd�Zedd��Z	dd�Z
edd	��Zedd
��Zedd��Z
edd��Zedd
��Zedd��Zdd�Zy)�PluginTestsz_
    Tests which verify the behavior of the current, active Twisted plugins
    directory.
    c���tjdd|_tjj	�|_t
|j��|_|jj�|jjd�|_|jj�|jjd�jd�t
t�jd�j|jjd��d|_tjj#d|jj�ddl}||_y)	zV
        Save C{sys.path} and C{sys.modules}, and create a package for tests.
        N�	mypackage�__init__.pyrzplugin_basic.pyz
testplugin.py�
testpluginr)�sys�path�originalPath�modules�copy�savedModulesr�mktemp�root�createDirectory�child�package�
setContent�__file__�sibling�copyTo�originalPlugin�insertr!�module)�selfr!s  r�setUpzPluginTests.setUp2s��� �H�H�Q�K����K�K�,�,�.����T�[�[�]�+��	��	�	�!�!�#��y�y���{�3������$�$�&������=�)�4�4�S�9����"�"�#4�5�<�<��L�L����/�	
�+���������4�9�9�>�>�*����rc���|jtjddtjj	�tjj|j�y�zR
        Restore C{sys.path} and C{sys.modules} to their original values.
        N�r&r$r%r'�clear�updater)�r6s r�tearDownzPluginTests.tearDownJ�?���'�'�����������������4�,�,�-rc��|j�J�|jjd�}dj|dd�}|d}t	t
j||�t
j|j=ddg|xrdgxsgzD]%}	tj|j|z��'y#t$rY�4wxYw)N�.����c�o�)
r0r�split�join�delattrr$r'�os�remove�FileNotFoundError)r6r5�deleteSource�
modulePath�packageName�
moduleName�exts       r�_unimportPythonModulez!PluginTests._unimportPythonModuleRs������*�*�*��_�_�*�*�3�/�
��h�h�z�#�2��/����^�
�����K�(�*�5��K�K����(���:��!6�2�$�!<�"�=�	�C�
��	�	�&�/�/�C�/�0�	��%�
��
�s�"B4�4	C�?Cc�V�|jjd�j�y)z;
        Remove the plugins B{droping.cache} file.
        �dropin.cacheN)r.r-rJr=s r�_clearCachezPluginTests._clearCachebs��	
�����>�*�1�1�3rc�D��tj��d�fd��}|S)z�
        This is a paranoid test wrapper, that calls C{meth} 2 times, clear the
        cache, and calls it 2 other times. It's supposed to ensure that the
        plugin system behaves correctly no matter what the state of the cache
        is.
        c�f���|��|�|j��|��|�y)N)rT)r6�meths �r�wrappedz+PluginTests._withCacheness.<locals>.wrappedrs+�����J���J�������J���Jr)r6r�return�None)�	functools�wraps)rWrXs` r�_withCachenesszPluginTests._withCachenesshs'���
����	�	�
�	��rc�P�tj|j�}||j}|j	|j
d|j���|j
d|j�|jD�cgc]}t|jvs�|��c}d}|j|j|�|j	|jd�|j	|jj�d�|j	|jttjg�|j!�}|j|t"j$d|j��j&�ddlm}|j||j&�ycc}w)a	
        Check that the cache returned by L{plugin.getCache} hold the plugin
        B{testplugin}, and that this plugin has the properties we expect:
        provide L{TestPlugin}, has the good name and description, and can be
        loaded successfully.
        z
mypackage.zI'm a test drop-in.r�
TestPluginz*A plugin used solely for testing purposes.N)r
�getCacher5r3�assertEqualrO�assertIn�description�pluginsr�provided�assertIs�dropin�name�strip�IPlugin�loadr$r'r_�mypackage.testpluginr#)r6�cacherg�p�p1�
realPlugin�tps       r�
test_cachezPluginTests.test_cache|sD��������,���t�*�*�+������*�*�j��9L�9L�8M�,N�O��
�
�+�V�-?�-?�@� ���
E�A�;�!�*�*�+D�a�
E�a�
H���
�
�b�i�i��(�������,�/�	
����N�N� � �"�$P�	
�	
������{�F�N�N�&C�D��W�W�Y�
��
�
���K�K�*�T�%8�%8�$9�:�;�F�F�	
�	*��
�
�j�"�-�-�0��)Fs�F#�F#c���tj|j�|j}t	d�|j
D��d}|j
t|�d�y)zm
        L{CachedPlugin} has a helpful C{repr} which contains relevant
        information about it.
        c3�@K�|]}|jdk(s�|���y�w)r_N�rh)�.0rns  r�	<genexpr>z-PluginTests.test_cacheRepr.<locals>.<genexpr>�s����V�!�q�v�v��?U�A�V�s��rzT<CachedPlugin 'TestPlugin'/'mypackage.testplugin' (provides 'ITestPlugin, IPlugin')>N)r
r`r5r3�listrdra�repr)r6�cachedDropin�cachedPlugins   r�test_cacheReprzPluginTests.test_cacheRepr�s\��
���t�{�{�3�D�4G�4G�H���V�|�';�';�V�V�
�
��	
������
1�	
rc��ttjt|j��}|jt
|�d�ddg}|D]-}|j|j�|j��/y)a
        L{plugin.getPlugins} should return the list of plugins matching the
        specified interface (here, L{ITestPlugin2}), and these plugins
        should be instances of classes with a C{test} method, to be sure
        L{plugin.getPlugins} load classes correctly.
        ��AnotherTestPlugin�ThirdTestPluginN)
rxr
�
getPluginsrr5ra�lenrJr�test)r6rd�namesrns    r�test_pluginszPluginTests.test_plugins�sf���v�(�(��t�{�{�C�D������W��q�)�$�&7�8���	�A��L�L����$�
�F�F�H�	rc��tt�jd�j|jjd��	|j
dtj�|jttjdd�d�ttjt|j��}|j!t#|�d�dd	g}|D]-}|j%|j&�|j)��/	|j+tjdd
�y#|j+tjdd
�wxYw)ze
        Check that L{plugin.getPlugins} is able to detect plugins added at
        runtime.
        �plugin_extra1.py�pluginextra.py�mypackage.pluginextrar!�pluginextraz&mypackage still has pluginextra moduler~r_�FourthTestPluginTN)rr0r1r2r.r-�failIfInr$r'�assertFalse�hasattrrxr
r�rr5rar�rJr�test1rQ�r6�plgsr�rns    r�test_detectNewFileszPluginTests.test_detectNewFiles�s��	���"�"�#5�6�=�=��L�L���/�0�	
�	S��M�M�1�3�;�;�?��������K�0�-�@�8�
�
��)�)�+�t�{�{�C�D�D�
���S��Y��*�!�#5�6�E��
�����Q�Z�Z�(����	�
�
�&�&�s�{�{�3J�'K�T�R��D�&�&�s�{�{�3J�'K�T�R�s
�CD8�8%Ec��tt�jd�j|jjd��	t
tjt|j��}|jt|�d�tt�jd�j|jjd��|jtjd�t
tjt|j��}|jt|�d�gd�}|D]-}|j!|j"�|j%��/	|jtjdd�y	#|jtjdd�wxYw)
z�
        Check that if the content of a plugin change, L{plugin.getPlugins} is
        able to detect the new plugins added.
        r�r�r~zplugin_extra2.pyr��)r_r��FifthTestPluginTN)rr0r1r2r.r-rxr
r�rr5rar�rQr$r'rJrr�r�s    r�test_detectFilesChangedz#PluginTests.test_detectFilesChanged�sL��	���"�"�#5�6�=�=��L�L���/�0�	
�	S���)�)�+�t�{�{�C�D�D����S��Y��*��X��&�&�'9�:�A�A����"�"�#3�4�
�

�&�&�s�{�{�3J�'K�L���)�)�+�t�{�{�C�D�D����S��Y��*�I�E��
�����Q�Z�Z�(����	�
�
�&�&�s�{�{�3J�'K�T�R��D�&�&�s�{�{�3J�'K�T�R�s
�D.F�%Gc��tt�jd�j|jjd��	t
tjt|j��|jtjdd�t
tjt|j��}|jdt|��y#|jtjdd�wxYw)zs
        Check that when a dropin file is removed, L{plugin.getPlugins} doesn't
        return it anymore.
        r�r�r�T�N)rr0r1r2r.r-rxr
r�rr5rQr$r'rar�)r6r�s  r�test_detectFilesRemovedz#PluginTests.test_detectFilesRemoveds���	���"�"�#5�6�=�=��L�L���/�0�	
�	S���"�"�;����<�=�
�&�&�s�{�{�3J�'K�T�R��F�%�%�k�4�;�;�?�@������C��I�&��
�&�&�s�{�{�3J�'K�T�R�s�-C!�!%Dc��|j�}|jtjj	|��|j
jj|�	ttjt|j
��}|jt|�d�|j
jj|�y#|j
jj|�wxYw)zy
        Test that getCache skips over any entries in a plugin package's
        C{__path__} which do not exist.
        r�N)r*r�rIr%�existsr5�__path__�appendrxr
r�rrar�rJ)r6r%r�s   r�test_nonexistentPathEntryz%PluginTests.test_nonexistentPathEntrys����{�{�}�����������-�.������#�#�D�)�	.���)�)�+�t�{�{�C�D�D����S��Y��*��K�K� � �'�'��-��D�K�K� � �'�'��-�s
�%AC�'C:c�D�t|j��}|j|j��|j	�|jd�j}|jjj|�	ttjt|j��}|jt|�d�|jjj!|�y#|jjj!|�wxYw)z�
        Test that getCache skips over any entries in a plugin package's
        C{__path__} which refer to children of paths which are not directories.
        �test_packager�N)rr*r�r��touchr-r%r5r�r�rxr
r�rrar�rJ)r6r%r-r�s    r�test_nonDirectoryChildEntryz'PluginTests.test_nonDirectoryChildEntry"s�������
�&���������'��
�
���
�
�>�*�/�/�������#�#�E�*�	/���)�)�+�t�{�{�C�D�D����S��Y��*��K�K� � �'�'��.��D�K�K� � �'�'��.�s
�
AC8�8'Dc��tj|j�|jj	d�}tt�jd�j|jj	d��t�tj|jjd�tj|jd�|jtj|jjd�|jtj|jd�g}t|j�|jt |j�tj|j�}|j#d|�|j#|j$|�d|jt&j(fz}|D]}t+|�}|�J�||vs�y	|j-d
|���y	)z�
        The C{dropin.cache} file may not be writable: the cache should still be
        attainable, but an error should be logged to show that the cache
        couldn't be updated.
        rSr�r�i@�i�r��3Unable to write to plugin cache %s: error number %dN�9Did not observe unwriteable cache warning in log events: )r
r`r5r.r-rr0r1r2�invalidateImportCachesrI�chmodr%�
addCleanupr
r�rrbr3�errno�EPERMr�fail)r6�	cachepath�eventsrm�expected�event�	maybeTexts       r�test_deployedModezPluginTests.test_deployedMode3s���	������$��L�L�&�&�~�6�	�	���"�"�#5�6�=�=��L�L���/�0�	
�	� �
������"�"�E�*�
�������'�������$�,�,�"3�"3�U�;�������)�.�.�%�8�#%���F�M�M�"������
�
�6�������,���
�
�m�U�+��
�
�d�)�)�5�1�I��N�N��K�K�L
�
���		�E�)�%�0�I��(�(�(��9�$��			�
�I�I� &�)�
rN�rYrZ)F)r5rrL�boolrYrZ)rWzCallable[[PluginTests], object]rYzCallable[[PluginTests], None])rrrrr7r>rQrTr]rrr|r�r�r�r�r�r�r�rrrrr,s����
 �0.�8=�� ��04��	
�� 4��-��	&��(�"1��"1�H

����� �S��S�:�S��S�@�'��'�"�
.��
.��/��/� /rrsj
from twisted.plugin import pluginPackagePaths
__path__.extend(pluginPackagePaths(__name__))
__all__ = []
c�B�dj|�jd�S)Nz�from zope.interface import provider
from twisted.plugin import IPlugin
from twisted.test.test_plugin import ITestPlugin

@provider(IPlugin, ITestPlugin)
class {}:
    pass
�ascii)�format�encoderus r�pluginFileContentsr�ms ��
�
����	����rc��|j�|jd�}|j�|r |jd�jd�|jd�}|j�|r$|jd�jt�|j|dz�j|�|S)z'
    Create a plugindummy package.
    �plugindummyr"rrd�.py)r,r-r/�pluginInitFile)�	entrypath�
pluginContent�real�pluginModule�pkg�plugss      r�_createPluginDummyr�}s�������
�/�/�-�
(�C�������	�	�-� �+�+�C�0��I�I�i� �E�	�����
���M�"�-�-�n�=�	�K�K��u�$�%�0�0��?��Lrc��eZdZUded<y)�_HasBoolLegacyKeyr��legacyN)rrr�__annotations__rrrr�r��s���Lrr�c�`�eZdZdZd
d�Zd
d�Zd
d�Zdd�Zd
d�Zd
d�Z	d
d�Z
d
d	�Zd
d
�Zd
d�Z
y)�DeveloperSetupTestsz�
    These tests verify things about the plugin system without actually
    interacting with the deployed 'twisted.plugins' package, instead creating a
    temporary package.
    c�:�tjdd|_tjj	�|_t
|j��|_|jj�|jjd�|_|jjd�|_|jjd�|_
t|jtd�dd�|_t|jtd�dd�|_t|jtd	�d
d�|_tjj'|j|jfD�cgc]}|j��c}�|j)�|jjd�jd
�|_|j*jd�|_t/j.�}t1j2|j*jd�j|dz
fdz�t1j2|j,j|dz
fdz�|j5�|j7�ycc}w)a7
        Create a complex environment with multiple entries on sys.path, akin to
        a developer's environment who has a development (trunk) checkout of
        Twisted, a system installed version of Twisted (for their operating
        system's tools) and a project which provides Twisted plugins.
        N�system_path�development_path�application_path�systemT�plugindummy_builtin�dev�appF�plugindummy_appr�rdrSzplugindummy_builtin.pyi�r~i�)r$r%�	savedPathr'r(r)rr*�fakeRootr,r-�
systemPath�devPath�appPathr�r��
systemPackage�
devPackage�
appPackage�extend�
getAllPlugins�sysplug�syscache�timerI�utime�
lockSystem�resetEnvironment)r6�x�nows   rr7zDeveloperSetupTests.setUp�s������!�����K�K�,�,�.��� �����/��
��
�
�%�%�'��-�-�-�-�m�<����}�}�*�*�+=�>����}�}�*�*�+=�>���/��O�O�/��9�4�AV�
���-��L�L�,�U�3�T�;P�
���-��L�L�,�U�3�U�<M�
���
	�����$�/�/�4�<�<�)H�I�A����I�J�	
�������,�,�]�;�A�A�)�L������*�*�>�:��
��i�i�k��
������#�#�$<�=�B�B�S�4�Z�M�TU�DU�V�
������#�#�c�D�j�]�Q�%6�7�	
���������Js�9Jc��tj|jjd�tj|jjd�y)zW
        Lock the system directories, as if they were unwritable by this user.
        imN�rIr�r�r%r�r=s rr�zDeveloperSetupTests.lockSystem��4��	������"�"�E�*�
������#�#�U�+rc��tj|jjd�tj|jjd�y)zW
        Unlock the system directories, as if they were writable by this user.
        i�Nr�r=s r�unlockSystemz DeveloperSetupTests.unlockSystem�r�rc��ddl}ttjt|j
��}|D�cgc]}|j��c}Scc}w)zl
        Get all the plugins loadable from our dummy package, and return their
        short names.
        rN)�plugindummy.pluginsrxr
r�rrdr)r6r�r��plugs    rr�z!DeveloperSetupTests.getAllPlugins�s<��	#���"�"�;��0C�0C�D�E��*+�,�$��
�
�,�,��,s�Ac���|j�tjj|j|j
|jfD�cgc]}|j��c}�ycc}w)zc
        Change the environment to what it should be just as the test is
        starting.
        N)�unsetEnvironmentr$r%r�r�r�r�)r6r�s  rr�z$DeveloperSetupTests.resetEnvironment�sE��
	
���������$�,�,�������)V�W�A����W�X��Ws�A*c���t�tjj�tjj	|j
�|jtjddy)zh
        Change the Python environment back to what it was before the test was
        started.
        N)r�r$r'r;r<r)r�r%r=s rr�z$DeveloperSetupTests.unsetEnvironment�sC��
	� ������������4�,�,�-��n�n�����rc�D�|j�|j�y)z�
        Reset the Python environment to what it was before this test ran, and
        restore permissions on files which were marked read-only so that the
        directory may be cleanly cleaned up.
        N)r�r�r=s rr>zDeveloperSetupTests.tearDown�s��	
����
	
���rc��td�D]6}|j�}|j�|j|ddg��8y)a
        Plugins added in the development path should be loadable, even when
        the (now non-importable) system path contains its own idea of the
        list of plugins for a package.  Inversely, plugins added in the
        system path should not be available.
        r�r�r�N)�ranger��sortra)r6r�r�s   r�"test_developmentPluginAvailabilityz6DeveloperSetupTests.test_developmentPluginAvailability�sB���q��	4�A��&�&�(�E��J�J�L����U�U�E�N�3�	4rc�J�|jjd�}|jtd��t	j�dz
}tj|j||f�|jd�}td��}tj|jjfddi|��tj|j||f�|j�|j�|jd|j��|j!d	|j��|j�|jtd	��|j!d|j��|jd	|j��y
)z�
        Verify that if a stale .pyc file on the PYTHONPATH is replaced by a
        fresh .py file, the plugins in the new .py are picked up rather than
        the stale .pyc, even if the .pyc is still around.
        zstale.py�onei�z	stale.pycT)r��quietr��twoN)r�r-r/r�r�rIr�r%r1r��
compileall�compile_dirrJr�rbr�r�)r6�mypathr��pyc�extras     r�test_freshPyReplacesStalePycz0DeveloperSetupTests.test_freshPyReplacesStalePycs5�����&�&�z�2�����,�U�3�4��I�I�K�$���
������q�!�f�%��n�n�[�)��"��.�����t���3�3�F�1�F��F�
������A�q�6�"��
�
�������
�
�e�T�/�/�1�2��
�
�e�T�/�/�1�2��������,�U�3�4��
�
�e�T�/�/�1�2��
�
�e�T�/�/�1�2rc�p�|j�|jjd�jt	d��|j�tjj|jj�g}t|j�|jt|j�|jd|j��d|j jt"j$fz}|D]}t'|�}|�J�||vs�y|j)d|���y)aF
        Verify that a failure to write the dropin.cache file on a read-only
        path will not affect the list of plugins returned.

        Note: this test should pass on both Linux and Windows, but may not
        provide useful coverage on Windows due to the different meaning of
        "read-only directory".
        znewstuff.pyr�r�Nr�)r�r�r-r/r�r�r$r%rJr�r
r�r�rrbr�r�r�r�rr�)r6r�r�r�r�s     r�test_newPluginsOnReadOnlyPathz1DeveloperSetupTests.test_newPluginsOnReadOnlyPath,s��	
���������=�)�4�4�5G��5N�O�����	��������)�)�*�#%���F�M�M�"������
�
�6��
�
�e�T�/�/�1�2�I��M�M����K�K�L
�
���		�E�)�%�0�I��(�(�(��9�$��			�
�I�I� &�)�
rNr�)rYz	list[str])rrrrr7r�r�r�r�r�r>r�r�rrrrr�r��s<���( �T,�,�
-�Y�%��4�3�@&rr�c�H�eZdZdZdd�Zdd�Z								d	d�Zdd�Zdd�Zy)
�AdjacentPackageTestsz�
    Tests for the behavior of the plugin system when there are multiple
    installed copies of the package containing the plugins being loaded.
    c�z�tjdd|_tjj	�|_y)zS
        Save the elements of C{sys.path} and the items of C{sys.modules}.
        N)r$r%r&r'r(r)r=s rr7zAdjacentPackageTests.setUp[s)�� �H�H�Q�K����K�K�,�,�.��rc���|jtjddtjj	�tjj|j�yr9r:r=s rr>zAdjacentPackageTests.tearDownbr?rc��|j|�}|jd�}|j�|jd�jd�|jd�}|j�|jd�jt�|j|dz�}|jt	|��|S)a`
        Create a directory containing a Python package named I{dummy} with a
        I{plugins} subpackage.

        @type root: L{FilePath}
        @param root: The directory in which to create the hierarchy.

        @type name: C{str}
        @param name: The name of the directory to create which will contain
            the package.

        @type pluginName: C{str}
        @param pluginName: The name of a module to create in the
            I{dummy.plugins} package.

        @rtype: L{FilePath}
        @return: The directory which was created to contain the I{dummy}
            package.
        �dummyr"rrdr�)r-�makedirsr/r�r�)r6r+rh�
pluginName�	directoryr.rdr�s        r�createDummyPackagez'AdjacentPackageTests.createDummyPackagejs���,�J�J�t�$�	��/�/�'�*�������
�
�m�$�/�/��4��-�-�	�*�������
�
�m�$�/�/��?��}�}�Z�%�%7�8����� 2�4� 8�9��rc��t|j��}|j�|j|dd�}|j|dd�}tj
j
|j
�tj
j
|j
�ddl}ttjt|j��}|jdg|D�cgc]}|j��c}�ycc}w)z�
        Only plugins from the first package in sys.path should be returned by
        getPlugins in the case where there are two Python packages by the same
        name installed, each with a plugin module by a single name.
        �first�
someplugin�secondrN�rr*rrr$r%r��
dummy.pluginsrxr
r�rrdrar�r6r+�firstDirectory�secondDirectoryrrdrns       r�.test_hiddenPackageSamePluginModuleNameObscuredzCAdjacentPackageTests.test_hiddenPackageSamePluginModuleNameObscured��������
�&���
�
���0�0��w��M���1�1�$��,�O��������+�+�,�������,�,�-���v�(�(��e�m�m�D�E�����'���$A�A�Q�Z�Z�$A�B��$A��$C?
c��t|j��}|j�|j|dd�}|j|dd�}tj
j
|j
�tj
j
|j
�ddl}ttjt|j��}|jdg|D�cgc]}|j��c}�ycc}w)z�
        Plugins from the first package in sys.path should be returned by
        getPlugins in the case where there are two Python packages by the same
        name installed, each with a plugin module by a different name.
        r
�
thispluginr�
thatpluginrNrrs       r�3test_hiddenPackageDifferentPluginModuleNameObscuredzHAdjacentPackageTests.test_hiddenPackageDifferentPluginModuleNameObscured�rrNr�)r+�
FilePath[str]rh�strr	rrYr)	rrrrr7r>rrrrrrrrUsC���
/�.��!��),��:=��	��BC�(Crrc�0�eZdZdZdd�Zdd�Zdd�Zdd�Zy)�PackagePathTestszg
    Tests for L{plugin.pluginPackagePaths} which constructs search paths for
    plugin packages.
    c�4�tjdd|_y)z3
        Save the elements of C{sys.path}.
        N)r$r%r&r=s rr7zPackagePathTests.setUp�s�� �H�H�Q�K��rc�>�|jtjddy)z<
        Restore C{sys.path} to its original value.
        N)r&r$r%r=s rr>zPackagePathTests.tearDown�s���'�'�����rc�`�td�}td�}|j|jgt_|jt	j
d�|j
d�j
d�j|j
d�j
d�jg�y)z�
        L{plugin.pluginPackagePaths} should return a list containing each
        directory in C{sys.path} with a suffix based on the supplied package
        name.
        �foo�bar�
dummy.pluginsrrdN)rr%r$rar
�pluginPackagePathsr-)r6r#r$s   r�test_pluginDirectoriesz'PackagePathTests.test_pluginDirectories�s����u�o���u�o���H�H�c�h�h�'�������%�%�o�6��	�	�'�"�(�(��3�8�8��	�	�'�"�(�(��3�8�8�
�	
rc�,�t|j��}|jd�jd�jd�}|j�|jd�j	d�|jd�j
|jd�j
gt_|jtjd�|jd�jd�jd�j
g�y)	a�
        L{plugin.pluginPackagePaths} should exclude directories which are
        Python packages.  The only allowed plugin package (the only one
        associated with a I{dummy} package which Python will allow to be
        imported) will already be known to the caller of
        L{plugin.pluginPackagePaths} and will most commonly already be in
        the C{__path__} they are about to mutate.
        r#rrdr"rr$r%N)
rr*r-rr/r%r$rar
r&)r6r+r#s   r�test_pluginPackagesExcludedz,PackagePathTests.test_pluginPackagesExcluded�s�������
�&���j�j���%�%�g�.�4�4�Y�?�������	�	�-� �+�+�C�0��J�J�u�%�*�*�D�J�J�u�,=�,B�,B�C�������%�%�o�6�
�Z�Z��
�
$�
$�W�
-�
3�
3�I�
>�
C�
C�D�	
rNr�)rrrrr7r>r'r)rrrrr�s���
(�(�
�"
rr)rhrrY�bytes)
r�rr�r*r�r�r�rrYr)+r�
__future__rr�r�r[rIr$r��	importlibrr��typesr�typingrrr�zope.interfacer	�twistedr
�twisted.python.filepathr�twisted.python.logrr
rr�
twisted.trialrrrr�TestCaserr�r�r�r�r�rrrrr�<module>r5s���
�#����	�
��A��/�/�$��,�X�X�"��T�]���)���9��v�(�#�#�v�t	��
� ���-2��:>��NQ����&�	��~�(�+�+�~�B\C�8�,�,�\C�~4
�x�(�(�4
r

Zerion Mini Shell 1.0