HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/incremental/tests/__pycache__/test_update.cpython-38.pyc
U

��WN\�@s�dZddlmZmZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZmZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZdS)z"
Tests for L{incremental.update}.
�)�division�absolute_importN)�FilePath)�NativeStringIO)�TestCase)�_run�runc@seZdZdd�Zdd�ZdS)�NonCreatedUpdateTestscslt�����_�j���j�d�}|��|�d��d��fdd��_|�_Gdd�dt�}|��_	dS)N�
inctestpkg�__init__.py�
from incremental import Version
introduced_in = Version('inctestpkg', 'NEXT', 0, 0).short()
next_released_version = "inctestpkg NEXT"
cs�jjS�N��srcdir�path���selfr�?/usr/lib/python3/dist-packages/incremental/tests/test_update.py�<lambda>$�z-NonCreatedUpdateTests.setUp.<locals>.<lambda>c@seZdZdZdZdS)z)NonCreatedUpdateTests.setUp.<locals>.Date���N��__name__�
__module__�__qualname__ZyearZmonthrrrr�Date'sr�
rZmktempr�makedirs�child�
setContent�getcwd�
packagedir�object�date�rr#rrrr�setUps
zNonCreatedUpdateTests.setUpcCsn|�|j�d����g}tddddddd|j|j|jd�
|�|j�d����|�	|j�d��
�d�dS)zP
        `incremental.update package --create` initialises the version.
        �_version.pyr
NFT�	r�
newversion�patch�rc�dev�create�_dateZ_getcwd�_print�
"""
Provides inctestpkg version information.
"""

# This file is auto-generated! Do not edit!
# Use `python -m incremental.update inctestpkg` to change this file.

from incremental import Version

__version__ = Version('inctestpkg', 16, 8, 0)
__all__ = ["__version__"]
)ZassertFalser#r �existsrr%r"�append�
assertTrue�assertEqual�
getContent�r�outrrr�test_create-s��z!NonCreatedUpdateTests.test_createN)rrrr'r9rrrrr	sr	c@seZdZdd�Zdd�ZdS)�MissingTestscs�t�����_�j���j�d����j�d��d�}|��|�d��d�|�d��d��fdd��_|�_Gd	d
�d
t�}|��_	dS)NZsrcar
rrr(�h
from incremental import Version
__version__ = Version('inctestpkg', 1, 2, 3)
__all__ = ["__version__"]
cs�jjSr
rrrrrr^rz$MissingTests.setUp.<locals>.<lambda>c@seZdZdZdZdS)z MissingTests.setUp.<locals>.DaterrNrrrrrrasrrr&rrrr'Js
zMissingTests.setUpc
Cs@g}|�t��(tddddddd|j|j|jd�
W5QRXdS)zk
        `incremental.update package --dev` raises and quits if it can't find
        the package.
        r
NFTr))�assertRaises�
ValueErrorrr%r"r3r7rrr�	test_pathgs�zMissingTests.test_pathN�rrrr'r>rrrrr:Hsr:c@seZdZdd�Zdd�ZdS)�CreatedUpdateInSrcTestscs�t�����_�j���j�d����j�d��d�}|��|�d��d�|�d��d��fdd��_|�_Gd	d
�d
t�}|��_	dS)N�srcr
rrr(r;cs�jjSr
rrrrrr�rz/CreatedUpdateInSrcTests.setUp.<locals>.<lambda>c@seZdZdZdZdS)z+CreatedUpdateInSrcTests.setUp.<locals>.DaterrNrrrrrr�srrr&rrrr'us
zCreatedUpdateInSrcTests.setUpcCs�g}tddddddd|j|j|jd�
|�|j�d����|�|j�d��	�d�tddddddd|j|j|jd�
|�|j�d����|�|j�d��	�d�dS)	��
        `incremental.update package --path=<path> --dev` increments the dev
        version of the package on the given path
        r
NFTr)r(�"""
Provides inctestpkg version information.
"""

# This file is auto-generated! Do not edit!
# Use `python -m incremental.update inctestpkg` to change this file.

from incremental import Version

__version__ = Version('inctestpkg', 1, 2, 3, dev=0)
__all__ = ["__version__"]
s"""
Provides inctestpkg version information.
"""

# This file is auto-generated! Do not edit!
# Use `python -m incremental.update inctestpkg` to change this file.

from incremental import Version

__version__ = Version('inctestpkg', 1, 2, 3, dev=1)
__all__ = ["__version__"]
�
rr%r"r3r4r#r r2r5r6r7rrrr>�s6����z!CreatedUpdateInSrcTests.test_pathNr?rrrrr@ssr@c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS) �CreatedUpdateTestsNcs|t�����_�j���j�d�}|��|�d��d�|�d��d��fdd��_|�_Gdd	�d	t�}|��_	dS)
Nr
rrr(r;cs�jjSr
rrrrrr�rz*CreatedUpdateTests.setUp.<locals>.<lambda>c@seZdZdZdZdS)z&CreatedUpdateTests.setUp.<locals>.DaterrNrrrrrr�srrr&rrrr'�s
zCreatedUpdateTests.setUpcCsXg}td|jjddddd|j|jd�	|�|j�d����|�|j�d��	�d�dS)rBr
NFT)rr*r+r,r-r.r/r0r(rC)
rr#rr%r3r4r r2r5r6r7rrrr>�s��zCreatedUpdateTests.test_pathcCsXg}tddddddd|j|j|jd�
|�|j�d����|�|j�d��	�d�dS)zP
        `incremental.update package --dev` increments the dev version.
        r
NFTr)r(rCrDr7rrr�test_dev�s��zCreatedUpdateTests.test_devcCsZg}tddddddd|j|j|jd�
|�|j�d���d�|�|j�d���d	�dS)
zT
        `incremental.update package --patch` increments the patch version.
        r
NTFr)r(�"""
Provides inctestpkg version information.
"""

# This file is auto-generated! Do not edit!
# Use `python -m incremental.update inctestpkg` to change this file.

from incremental import Version

__version__ = Version('inctestpkg', 1, 2, 4)
__all__ = ["__version__"]
rs�
from incremental import Version
introduced_in = Version('inctestpkg', 1, 2, 4).short()
next_released_version = "inctestpkg 1.2.4"
�rr%r"r3r5r#r r6r7rrr�
test_patchs��
�zCreatedUpdateTests.test_patchcCsT|j�d��d�g}tddddddd|j|j|jd�
|�|j�d���d�dS)	z�
        `incremental.update package --patch` increments the patch version, and
        disregards any old prerelease/dev versions.
        r(�
from incremental import Version
__version__ = Version('inctestpkg', 1, 2, 3, release_candidate=1, dev=2)
__all__ = ["__version__"]
r
NTFr)rG�	r#r r!rr%r"r3r5r6r7rrr�"test_patch_with_prerelease_and_dev,s��z5CreatedUpdateTests.test_patch_with_prerelease_and_devcCsZg}tddddddd|j|j|jd�
|�|j�d���d�|�|j�d���d	�dS)
z�
        `incremental.update package --patch --rc` increments the patch
        version and makes it a release candidate.
        r
NTFr)r(s!"""
Provides inctestpkg version information.
"""

# This file is auto-generated! Do not edit!
# Use `python -m incremental.update inctestpkg` to change this file.

from incremental import Version

__version__ = Version('inctestpkg', 1, 2, 4, release_candidate=1)
__all__ = ["__version__"]
rs�
from incremental import Version
introduced_in = Version('inctestpkg', 1, 2, 4, release_candidate=1).short()
next_released_version = "inctestpkg 1.2.4rc1"
rHr7rrr�
test_rc_patchJs��
�z CreatedUpdateTests.test_rc_patchcCsl|j�d��d�g}tddddddd|j|j|jd�
|�|j�d���d�|�|j�d	���d
�dS)z�
        `incremental.update package --rc` increments the rc version if the
        existing version is an rc, and discards any dev version.
        r(rJr
NFTr)s!"""
Provides inctestpkg version information.
"""

# This file is auto-generated! Do not edit!
# Use `python -m incremental.update inctestpkg` to change this file.

from incremental import Version

__version__ = Version('inctestpkg', 1, 2, 3, release_candidate=2)
__all__ = ["__version__"]
rs�
from incremental import Version
introduced_in = Version('inctestpkg', 1, 2, 3, release_candidate=2).short()
next_released_version = "inctestpkg 1.2.3rc2"
rKr7rrr�test_rc_with_existing_rchs��
�z+CreatedUpdateTests.test_rc_with_existing_rccCsl|j�d��d�g}tddddddd|j|j|jd�
|�|j�d���d�|�|j�d	���d
�dS)z�
        `incremental.update package --rc`, when the package is not a release
        candidate, will issue a new major/minor rc, and disregards the micro
        and dev.
        r(so
from incremental import Version
__version__ = Version('inctestpkg', 1, 2, 3, dev=2)
__all__ = ["__version__"]
r
NFTr)�""""
Provides inctestpkg version information.
"""

# This file is auto-generated! Do not edit!
# Use `python -m incremental.update inctestpkg` to change this file.

from incremental import Version

__version__ = Version('inctestpkg', 16, 8, 0, release_candidate=1)
__all__ = ["__version__"]
r�
from incremental import Version
introduced_in = Version('inctestpkg', 16, 8, 0, release_candidate=1).short()
next_released_version = "inctestpkg 16.8.0rc1"
rKr7rrr�test_rc_with_no_rc�s��
�z%CreatedUpdateTests.test_rc_with_no_rccCs�g}tddddddd|j|j|jd�
|�|j�d���d�|�|j�d���d	�tddddddd|j|j|jd�
|�|j�d���d
�|�|j�d���d�dS)z�
        `incremental.update package`, when the package is a release
        candidate, will issue the major/minor, sans release candidate or dev.
        r
NFTr)r(rOrrPr1s�
from incremental import Version
introduced_in = Version('inctestpkg', 16, 8, 0).short()
next_released_version = "inctestpkg 16.8.0"
rHr7rrr�test_full_with_rc�s6��
���
�z$CreatedUpdateTests.test_full_with_rcc
CsTg}|�t��(}tddddddd|j|j|jd�
W5QRX|�|jjdd�dS)zy
        `incremental.update package`, when the package is NOT a release
        candidate, will raise an error.
        r
NFr)rz6You need to issue a rc before updating the major/minor�	r<r=rr%r"r3r5�	exception�args�rr8�errr�test_full_without_rc�s
�
�z'CreatedUpdateTests.test_full_without_rcc
Cs�g}|�t��(}tddddddd|j|j|jd�
W5QRX|�|jjdd�|�t��(}tddddddd|j|j|jd�
W5QRX|�|jjdd�|�t��(}tddddddd|j|j|jd�
W5QRX|�|jjdd�dS)	zV
        The `--newversion` flag can't be mixed with --patch, --rc, or --dev.
        r
N�1TFr)rzOnly give --newversionrSrVrrr�test_no_mix_newversion�s>
�
�
�z)CreatedUpdateTests.test_no_mix_newversionc
Cs�g}|�t��(}tddddddd|j|j|jd�
W5QRX|�|jjdd�|�t��(}tddddddd|j|j|jd�
W5QRX|�|jjdd�dS)zH
        The `--dev` flag can't be mixed with --patch, or --rc.
        r
NTFr)rzOnly give --devrSrVrrr�test_no_mix_dev
s*
�
�z"CreatedUpdateTests.test_no_mix_devc
Cs8g}|�t��(}tddddddd|j|j|jd�
W5QRX|�|jjdd�|�t��(}tddddddd|j|j|jd�
W5QRX|�|jjdd�|�t��(}tddddddd|j|j|jd�
W5QRX|�|jjdd�|�t��(}tddddddd|j|j|jd�
W5QRX|�|jjdd�dS)	zh
        The `--create` flag can't be mixed with --patch, --rc, --dev, or
        --newversion.
        r
NTFr)rzOnly give --createrYrSrVrrr�test_no_mix_createsR
�
�
�
�z%CreatedUpdateTests.test_no_mix_createcCsZg}tddddddd|j|j|jd�
|�|j�d���d�|�|j�d���d	�dS)
zw
        `incremental.update package --newversion=1.2.3rc1dev3`, will set that
        version in the package.
        r
Nz1.2.3rc1dev3Fr)r(s("""
Provides inctestpkg version information.
"""

# This file is auto-generated! Do not edit!
# Use `python -m incremental.update inctestpkg` to change this file.

from incremental import Version

__version__ = Version('inctestpkg', 1, 2, 3, release_candidate=1, dev=3)
__all__ = ["__version__"]
rs�
from incremental import Version
introduced_in = Version('inctestpkg', 1, 2, 3, release_candidate=1, dev=3).short()
next_released_version = "inctestpkg 1.2.3rc1dev3"
rHr7rrr�test_newversion<s
��
�z"CreatedUpdateTests.test_newversioncCsZg}tddddddd|j|j|jd�
|�|j�d���d�|�|j�d���d	�dS)
zl
        `incremental.update package --newversion=1`, will set that
        version in the package.
        r
NrYFr)r(s"""
Provides inctestpkg version information.
"""

# This file is auto-generated! Do not edit!
# Use `python -m incremental.update inctestpkg` to change this file.

from incremental import Version

__version__ = Version('inctestpkg', 1, 0, 0)
__all__ = ["__version__"]
rs�
from incremental import Version
introduced_in = Version('inctestpkg', 1, 0, 0).short()
next_released_version = "inctestpkg 1.0.0"
rHr7rrr�test_newversion_bare[s
��
�z'CreatedUpdateTests.test_newversion_bare)rrrZmaxDiffr'r>rFrIrLrMrNrQrRrXrZr[r\r]r^rrrrrE�s $%6rEc@s$eZdZdd�Zdd�Zdd�ZdS)�ScriptTestscs�t�����_�j���j�d����j�d��d�}|��|�d��d�|�d��d��fdd��_|�_Gd	d
�d
t��G�fdd�dt�}|��_	dS)
NrAr
rrr(r;cs�jjSr
rrrrrr�rz#ScriptTests.setUp.<locals>.<lambda>c@seZdZdZdZdS)zScriptTests.setUp.<locals>.DaterrNrrrrrr�srcseZdZ�fdd�ZdS)z%ScriptTests.setUp.<locals>.DateModulecs��Sr
rr�rrr�today�sz+ScriptTests.setUp.<locals>.DateModule.todayN)rrrrarr`rr�
DateModule�srbr)rr#rbr)rrrr'|s
zScriptTests.setUpc	Cs\t�}|�td|�|�t��}tdg�W5QRX|�|jjdd�|�	d|�
��dS)�I
        Calling run() with no args will cause it to print help.
        �stdoutz--helprzShow this message and exitN)rr+�sysr<�
SystemExitrr5rTrU�assertIn�getvalue�rZstringiorWrrr�test_run�szScriptTests.test_runc	Cs�t�}|�td|�|�td|j�|�td|j�|�t��}t	ddg�W5QRX|�
|jjdd�|�
d|���|�
|j�d���d	�|�
|j�d
���d�dS)
rcrdr"r%r
z--rcrzUpdating codebaser(rOrrPN)rr+re�osr"�datetimer%r<rfrr5rTrUrgrhr#r r6rirrr�test_insufficient_args�s�
�z"ScriptTests.test_insufficient_argsN)rrrr'rjrmrrrrr_zs!
r_)�__doc__Z
__future__rrrerkrlZtwisted.python.filepathrZtwisted.python.compatrZtwisted.trial.unittestrZincremental.updaterrr	r:r@rEr_rrrr�<module>s 3+L>