HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1953949/root/usr/lib/python3/dist-packages/pbr/tests/__pycache__/
Upload File :
Current File : //proc/1953949/root/usr/lib/python3/dist-packages/pbr/tests/__pycache__/test_util.cpython-311.pyc
�

㦧b)���ddlZddlZddlZddlZddlmZddlZddlmZddl	m
Z
d�ZGd�dej��Z
Gd�d	ej��ZGd
�dej��ZGd�d
ej��ZGd�dej��ZGd�dej��ZGd�dej��ZGd�dej��ZdS)�N)�configparser)�base)�utilc��i}tjdkrtj��}ntj��}tjtj|����}|�	tj|����|���D]'}t|�|����||<�(|S)N)��)�sys�version_infor�ConfigParser�SafeConfigParser�textwrap�dedent�six�u�readfp�io�StringIO�sections�dict�items)�ini�config�parser�sections    �5/usr/lib/python3/dist-packages/pbr/tests/test_util.py�config_from_inirs���
�F�
��6�!�!��*�,�,����.�0�0��
�/�#�%��*�*�
%�
%�C�
�M�M�"�+�c�"�"�#�#�#��?�?�$�$�6�6���v�|�|�G�4�4�5�5��w����M�c��eZdZd�ZdS)�
TestBasicsc�J�d|_d}idd�dd�dd�dd	�d
d�dd
�dd�dd�dd�dd�dddg�ddg�dd�dddg�d d!g�d"d#�d$d%g�d&gd'gid(d)idgd*d+gd,gd-�d.gd/d0d1gfd2d3gfgd4gd5gd6�
�}t|��}tj|��}|�||��dS)7Na�
            [metadata]
            name = foo
            version = 1.0
            author = John Doe
            author_email = jd@example.com
            maintainer = Jim Burke
            maintainer_email = jb@example.com
            home_page = http://example.com
            summary = A foobar project.
            description = Hello, world. This is a long description.
            download_url = http://opendev.org/x/pbr
            classifier =
                Development Status :: 5 - Production/Stable
                Programming Language :: Python
            platform =
                any
            license = Apache 2.0
            requires_dist =
                Sphinx
                requests
            setup_requires_dist =
                docutils
            python_requires = >=3.6
            provides_dist =
                bax
            provides_extras =
                bar
            obsoletes_dist =
                baz

            [files]
            packages_root = src
            packages =
                foo
            package_data =
                "" = *.txt, *.rst
                foo = *.msg
            namespace_packages =
                hello
            data_files =
                bitmaps =
                    bm/b1.gif
                    bm/b2.gif
                config =
                    cfg/data.cfg
            scripts =
                scripts/hello-world.py
            modules =
                mod1
            �name�foo�versionz1.0�authorzJohn Doe�author_emailzjd@example.com�
maintainerz	Jim Burke�maintainer_emailzjb@example.com�urlzhttp://example.com�descriptionzA foobar project.�long_descriptionz)Hello, world. This is a long description.�download_urlzhttp://opendev.org/x/pbr�classifiersz+Development Status :: 5 - Production/StablezProgramming Language :: Python�	platforms�any�licensez
Apache 2.0�install_requires�Sphinx�requests�setup_requires�docutils�python_requiresz>=3.6�provides�bax�bar�baz��srcz*.txt,z*.rstz*.msg)r:r"�hello�bitmapsz	bm/b1.gifz	bm/b2.gifrzcfg/data.cfgzscripts/hello-world.py�mod1)
�provides_extras�	obsoletes�extras_require�package_dir�packages�package_data�namespace_packages�
data_files�scripts�
py_modules)�maxDiffrr�setup_cfg_to_setup_kwargs�assertDictEqual)�self�config_text�expectedr�actuals     r�test_basicszTestBasics.test_basics+s������2��f)
��F�)
��v�)
�
�k�)
�
�-�	)
�

�,�)
�
� 1�
)
�
�(�)
�
�/�)
�
� L�)
�
�7�)
�
�>�1��)
�
�&��)
� 
�}�!)
�"
���!�#)
�*
�{�m�+)
�,
�x�-)
�.
���/)
�0!'�x� �� ���<����w�'��y���$,�*��[�+�6�7��N�+�,��2�2�"�)�Q)
�)
�)
��T!��-�-���/��7�7�����X�v�.�.�.�.�.rN)�__name__�
__module__�__qualname__rP�rrrr)s(������a/�a/�a/�a/�a/rrc�`�eZdZddddgddgdgdgd�d	�fd
dddgd
dgd�d	�fddid	�fgZd�ZdS)�!TestExtrasRequireParsingScenarios�
simple_extrasz�
                [extras]
                first =
                    foo
                    bar==1.0
                second =
                    baz>=3.2
                    foo
                r"zbar==1.0zbaz>=3.2z
requests-mock�ordereddict)�first�second�test�test:(python_version=='2.6'))rM�expected_extra_requires�with_markersz�
                [extras]
                test =
                    foo:python_version=='2.6'
                    bar
                    baz<1.6 :python_version=='2.6'
                    zaz :python_version>'1.0'
                zbaz<1.6r8�zaz)r\r[�	no_extraszG
            [metadata]
            long_description = foo
            c��t|j��}tj|��}|�|j|d��dS)NrA)rrMrrJ�assertEqualr]�rLr�kwargss   r�test_extras_parsingz5TestExtrasRequireParsingScenarios.test_extras_parsing�sR�� ��!1�2�2���/��7�7������5�� 0�1�	3�	3�	3�	3�	3rN)rQrRrS�	scenariosrerTrrrVrV�s�������
�� ��,�%�u�-�(�)�1>��	(�(�
�
�	�"
��27�	�0B����((�((�)�)�	*�
��

�

�
�	�=%�I�N3�3�3�3�3rrVc��eZdZd�ZdS)�TestInvalidMarkersc�^�dddii}|�ttj|��dS)N�extrasr[zfoo :bad_marker>'1.0')�assertRaises�SyntaxErrorrrJ)rLrs  r� test_invalid_marker_raises_errorz3TestInvalidMarkers.test_invalid_marker_raises_error�s3���V�%<�=�>�����+�t�'E�v�N�N�N�N�NrN)rQrRrSrmrTrrrhrh�s(������O�O�O�O�Orrhc�@�eZdZdddddd�d�fdd	d
ddd�d�fgZd
�ZdS)�TestMapFieldsParsingScenarios�simple_project_urlsa
                [metadata]
                project_urls =
                    Bug Tracker = https://bugs.launchpad.net/pbr/
                    Documentation = https://docs.openstack.org/pbr/
                    Source Code = https://opendev.org/openstack/pbr
                zhttps://bugs.launchpad.net/pbr/zhttps://docs.openstack.org/pbr/z!https://opendev.org/openstack/pbr)zBug Tracker�
DocumentationzSource Code)rM�expected_project_urls�query_parametersaG
                [metadata]
                project_urls =
                    Bug Tracker = https://bugs.launchpad.net/pbr/?query=true
                    Documentation = https://docs.openstack.org/pbr/?foo=bar
                    Source Code = https://git.openstack.org/cgit/openstack-dev/pbr/commit/?id=hash
                z*https://bugs.launchpad.net/pbr/?query=truez'https://docs.openstack.org/pbr/?foo=barz@https://git.openstack.org/cgit/openstack-dev/pbr/commit/?id=hashc��t|j��}tj|��}|�|j|d��dS)N�project_urls)rrMrrJrbrrrcs   r�test_project_url_parsingz6TestMapFieldsParsingScenarios.test_project_url_parsing�sF�� ��!1�2�2���/��7�7������3�V�N�5K�L�L�L�L�LrN)rQrRrSrfrvrTrrroro�s�������
�� A�!B�B�&�&�
!
�
!
�
	�
�� L�!J�a�&�&�

�

�
	��I�>M�M�M�M�Mrroc�6�eZdZddgd�d�fdddgd�fgZd�Zd	S)
�TestKeywordsParsingScenarios�
keywords_listz�
                [metadata]
                keywords =
                    one
                    two
                    three
                )�one�two�three)rM�expected_keywords�inline_keywordszW
                [metadata]
                keywords = one, two, three
                zone, two, threec��t|j��}tj|��}|�|j|d��dS)N�keywords)rrMrrJrbr}rcs   r�test_keywords_parsingz2TestKeywordsParsingScenarios.test_keywords_parsingsF�� ��!1�2�2���/��7�7������/��
�1C�D�D�D�D�DrN)rQrRrSrfr�rTrrrxrx�st������
��"9�!8�!8�	
�	
�
	
�
��#4�!4�
�
�	��I�*E�E�E�E�Errxc��eZdZd�ZdS)�TestProvidesExtrasc��d}t|��}tj|��}|�ddg|d��dS)NzX
        [metadata]
        provides_extras = foo
                          bar
        r"r8r?)rrrJrb)rLrrrds    r�test_provides_extrasz'TestProvidesExtras.test_provides_extrassN����
!��%�%���/��7�7�����%����0A�)B�C�C�C�C�CrN)rQrRrSr�rTrrr�r�
s(������D�D�D�D�Drr�c�.�eZdZdddddgfgd�fgZd�ZdS)	�TestDataFilesParsingrFz�
            [files]
            data_files =
                'i like spaces/' =
                    'dir with space/file with spc 2'
                    'dir with space/file with spc 1'
            zi like spaces/zdir with space/file with spc 2zdir with space/file with spc 1)rMrFc��t|j��}tj|��}|�|j|d��dS)NrF)rrMrrJrbrFrcs   r�)test_handling_of_whitespace_in_data_filesz>TestDataFilesParsing.test_handling_of_whitespace_in_data_files*sE�� ��!1�2�2���/��7�7�������&��*>�?�?�?�?�?rN)rQrRrSrfr�rTrrr�r�sd������
��"�$D�$D�$F�G��
�
�	�
�I�@�@�@�@�@rr�c��eZdZd�ZdS)�TestUTF8DescriptionFilec�J�tj��\}}d}d}||z}tj|dd���5}|�|��ddd��n#1swxYwYt|��}t
j|��}|�||d��dS)Nz:
        [metadata]
        description_file = %s
        u UTF8 description: é"…-ʃŋ'

�w�utf8)�encodingr*)	�tempfile�mkstempr�open�writerrrJrb)	rL�_�path�ini_template�unicode_descriptionr�frrds	         r�test_utf8_description_filez2TestUTF8DescriptionFile.test_utf8_description_file2s����"�$�$���4���E���T�!��
�W�T�3��
0�
0�
0�	)�A�
�G�G�'�(�(�(�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)� ��%�%���/��7�7�����,�f�5G�.H�I�I�I�I�Is�A�A� AN)rQrRrSr�rTrrr�r�1s(������J�J�J�J�Jrr�)rr�r
r�	six.movesrr	�	pbr.testsr�pbrrr�BaseTestCaserrVrhrorxr�r�r�rTrr�<module>r�s(�� 
�	�	�	���������
�
�
�
�"�"�"�"�"�"�
�
�
�
�������������
�
�
�c/�c/�c/�c/�c/��"�c/�c/�c/�L.3�.3�.3�.3�.3��(9�.3�.3�.3�bO�O�O�O�O��*�O�O�O�%M�%M�%M�%M�%M�D�$5�%M�%M�%M�PE�E�E�E�E�4�#4�E�E�E�<	D�	D�	D�	D�	D��*�	D�	D�	D�@�@�@�@�@�4�,�@�@�@�0J�J�J�J�J�d�/�J�J�J�J�Jr