ؒeڄdZddlmZmZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZmZGdd e ZGd d e ZGd d e ZGdde ZGdde Zy)z" Tests for L{incremental.update}. )divisionabsolute_importN)FilePath)NativeStringIO)TestCase)_runrunceZdZdZdZy)NonCreatedUpdateTestscdtj_jjjj d}|j|j dj dfd_|_Gddt}|_ y)N inctestpkg __init__.py from incremental import Version introduced_in = Version("inctestpkg", "NEXT", 0, 0).short() next_released_version = "inctestpkg NEXT" c0jjSNsrcdirpathselfs?/usr/lib/python3/dist-packages/incremental/tests/test_update.pyz-NonCreatedUpdateTests.setUp..%dkk..ceZdZdZdZy))NonCreatedUpdateTests.setUp..DateN__name__ __module__ __qualname__yearmonthrrDater( DErr& rmktemprmakedirschild setContentgetcwd packagedirobjectdaterr.r&s` rsetUpzNonCreatedUpdateTests.setUpst{{}-  [[&&|4 '22  / $ 6 F rc |j|jjdjg}t dddddddd|j |j |j |j|jjdj|j|jjdjdy)zP `incremental.update package --create` initialises the version. _version.pyr NFT r newversionpatchrcpostdevcreate_date_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__"] ) assertFalser.r+existsrr0r-append assertTrue assertEqual getContentrouts r test_createz!NonCreatedUpdateTests.test_create.s ..}=DDFG ))KK::  --m<CCEF  OO ! !- 0 ; ; =  rN)r r!r"r2rHr%rrr r s 0$ rr ceZdZdZdZy) MissingTestsctj_jjjj djjj dj d}|j|j dj d|j dj dfd_|_Gdd t}|_ y) Nsrcar rrr4h from incremental import Version __version__ = Version("inctestpkg", 1, 2, 3) __all__ = ["__version__"] c0jjSrrrsrrz$MissingTests.setUp..nrrceZdZdZdZy) MissingTests.setUp..DaterrNrr%rrr&rPqr'rr&r(r1s` rr2zMissingTests.setUpVst{{}-   &!**,[[&&v.44\B '22   '22  / $ 6 F rcg}|jt5tdddddddd|j|j|j  dddy#1swYyxYw)zk `incremental.update package --dev` raises and quits if it can't find the package. r NFTr5) assertRaises ValueErrorrr0r-rBrFs r test_pathzMissingTests.test_pathwsa    z *  ii zz    s 5AANr r!r"r2rTr%rrrJrJUs BrrJceZdZdZdZy)CreatedUpdateInSrcTestsctj_jjjj djjj dj d}|j|j dj d|j dj dfd_|_Gdd t}|_ y) Nsrcr rrr4rMc0jjSrrrsrrz/CreatedUpdateInSrcTests.setUp..rrceZdZdZdZy)+CreatedUpdateInSrcTests.setUp..DaterrNrr%rrr&r\r'rr&r(r1s` rr2zCreatedUpdateInSrcTests.setUpst{{}-   % ))+[[&&u-33LA '22   '22  / $ 6 F rc g}tdddddddd|j|j|j |j |j j dj|j|j j djdtdddddddd|j|j|j |j |j j dj|j|j j djdy) `incremental.update package --path= --dev` increments the dev version of the package on the given path r NFTr5r4""" 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__"] rr0r-rBrCr.r+rArDrErFs rrTz!CreatedUpdateInSrcTests.test_paths  ))KK::  --m<CCEF  OO ! !- 0 ; ; =  ))KK::  --m<CCEF  OO ! !- 0 ; ; =  rNrUr%rrrWrWsBB rrWceZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZy)CreatedUpdateTestsNctj_jjjj d}|j|j dj d|j dj dfd_|_Gddt}|_ y) Nr rrr4rMc0jjSrrrsrrz*CreatedUpdateTests.setUp..rrceZdZdZdZy)&CreatedUpdateTests.setUp..DaterrNrr%rrr&rfr'rr&r(r1s` rr2zCreatedUpdateTests.setUpst{{}-  [[&&|4 '22   '22  / $ 6 F rc dg}td|jjdddddd|j|j |j |jj dj|j|jj djdy)r^r NFT) rr6r7r8r9r:r;r<r>r4r_) rr.rr0rBrCr+rArDrErFs rrTzCreatedUpdateTests.test_paths  %%))::  --m<CCEF  OO ! !- 0 ; ; =  rc Rg}tdddddddd|j|j|j |j |j j dj|j|j j djdy)zP `incremental.update package --dev` increments the dev version. r NFTr5r4r_r`rFs rtest_devzCreatedUpdateTests.test_dev;s ))KK::  --m<CCEF  OO ! !- 0 ; ; =  rc Tg}tdddddddd|j|j|j |j |j j djd|j |j j djd y) zT `incremental.update package --patch` increments the patch version. r NTFr5r4 """ 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" rr0r-rBrDr.r+rErFs r test_patchzCreatedUpdateTests.test_patch_s ))KK::   OO ! !- 0 ; ; =    OO ! !- 0 ; ; =  rc 6|jjdjdg}tdddddddd|j|j |j  |j|jjdjdy) z `incremental.update package --patch` increments the patch version, and disregards any old prerelease/dev versions. r4 from incremental import Version __version__ = Version("inctestpkg", 1, 2, 3, release_candidate=1, dev=2) __all__ = ["__version__"] r NTFr5rk r.r+r,rr0r-rBrDrErFs r"test_patch_with_prerelease_and_devz5CreatedUpdateTests.test_patch_with_prerelease_and_devs m,77   ))KK::   OO ! !- 0 ; ; =  rc Tg}tdddddddd|j|j|j |j |j j djd|j |j j djd y) z `incremental.update package --patch --rc` increments the patch version and makes it a release candidate. r NTFr5r4s!""" 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.4.rc1" rlrFs r test_rc_patchz CreatedUpdateTests.test_rc_patchs  ))KK::   OO ! !- 0 ; ; =    OO ! !- 0 ; ; =  rc |jjdjdg}tdddddddd|j|j |j  |j|jjdjd|j|jjd jd y) z `incremental.update package --rc` increments the rc version if the existing version is an rc, and discards any dev version. r4ror NFTr5s!""" 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.3.rc2" rprFs rtest_rc_with_existing_rcz+CreatedUpdateTests.test_rc_with_existing_rcs m,77   ))KK::   OO ! !- 0 ; ; =    OO ! !- 0 ; ; =  rc |jjdjdg}tdddddddd|j|j |j  |j|jjdjd|j|jjd jd y) 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. r4so from incremental import Version __version__ = Version("inctestpkg", 1, 2, 3, dev=2) __all__ = ["__version__"] r NFTr5"""" 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.0.rc1" rprFs rtest_rc_with_no_rcz%CreatedUpdateTests.test_rc_with_no_rcs m,77   ))KK::   OO ! !- 0 ; ; =    OO ! !- 0 ; ; =  rc g}tdddddddd|j|j|j |j |j j djd|j |j j djd tdddddddd|j|j|j |j |j j djd |j |j j djd y) z `incremental.update package`, when the package is a release candidate, will issue the major/minor, sans release candidate or dev. r NFTr5r4rwrrxr?s from incremental import Version introduced_in = Version("inctestpkg", 16, 8, 0).short() next_released_version = "inctestpkg 16.8.0" rlrFs rtest_full_with_rcz$CreatedUpdateTests.test_full_with_rcKs5  ))KK::   OO ! !- 0 ; ; =    OO ! !- 0 ; ; =   ))KK::   OO ! !- 0 ; ; =    OO ! !- 0 ; ; =  rcg}|jt5}tdddddddd|j|j|j  ddd|j jjddy#1swY3xYw)zy `incremental.update package`, when the package is NOT a release candidate, will raise an error. r NFr5rz6You need to issue a rc before updating the major/minor rRrSrr0r-rBrD exceptionargsrrGes rtest_full_without_rcz'CreatedUpdateTests.test_full_without_rcs    z * a ii zz    KK  Q  D   s 5A??Bc Rg}tdddddddd|j|j|j |j |j j dj|j|j j djdy)zR `incremental.update package --post` increments the post version. r NFTr5r4""" 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, post=0) __all__ = ["__version__"] r`rFs r test_postzCreatedUpdateTests.test_posts ))KK::  --m<CCEF  OO ! !- 0 ; ; =  rc 6|jjdjdg}tdddddddd|j|j |j  |j|jjdjdy) z `incremental.update package --post` increments the post version, and disregards any old prerelease/dev versions. r4ror NFTr5rrprFs r!test_post_with_prerelease_and_devz4CreatedUpdateTests.test_post_with_prerelease_and_devs m,77   ))KK::   OO ! !- 0 ; ; =  rc |jjdjdg}tdddddddd|j|j |j  |j|jjdjd|j|jjd jd y) z `incremental.update package --post` increments the post version if the existing version is an postrelease, and discards any dev version. r4sw from incremental import Version __version__ = Version("inctestpkg", 1, 2, 3, post=1, dev=2) __all__ = ["__version__"] r NFTr5s""" 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, post=2) __all__ = ["__version__"] rs from incremental import Version introduced_in = Version("inctestpkg", 1, 2, 3, post=2).short() next_released_version = "inctestpkg 1.2.3.post2" rprFs rtest_post_with_existing_postz/CreatedUpdateTests.test_post_with_existing_posts m,77   ))KK::   OO ! !- 0 ; ; =    OO ! !- 0 ; ; =  rcDg}|jt5}tdddddddd|j|j|j  ddd|j jjdd|jt5}tdddddddd|j|j|j  ddd|j |jjdd|jt5}tdddddddd|j|j|j  ddd|j |jjdd|jt5}tdddddddd|j|j|j  ddd|j |jjddy#1swYxYw#1swY7xYw#1swYxYw#1swYYxYw) zf The `--newversion` flag can't be mixed with --patch, --rc, --post, or --dev. r N1TFr5rzOnly give --newversionr}rs rtest_no_mix_newversionz)CreatedUpdateTests.test_no_mix_newversion;s    z * a ii zz   ))!,.FG   z * a ii zz   ))!,.FG   z * a ii zz   ))!,.FG   z * a ii zz   ))!,.FG}        s/5G05G=5H  5H0G:=H HHc4g}|jt5}tdddddddd|j|j|j  ddd|j jjdd|jt5}tdddddddd|j|j|j  ddd|j |jjdd|jt5}tdddddddd|j|j|j  ddd|j |jjddy#1swY*xYw#1swYxYw#1swYLxYw)zP The `--dev` flag can't be mixed with --patch, --rc, or --post. r NTFr5rzOnly give --devr}rs rtest_no_mix_devz"CreatedUpdateTests.test_no_mix_devs~   z * a ii zz   ))!,.?@   z * a ii zz   ))!,.?@   z * a ii zz   ))!,.?@]      s#5E55F5F5E?F FcTg}|jt5}tdddddddd|j|j|j  ddd|j jjdd|jt5}tdddddddd|j|j|j  ddd|j |jjdd|jt5}tdddddddd|j|j|j  ddd|j |jjdd|jt5}tdddddddd|j|j|j  ddd|j |jjdd|jt5}tdddddddd|j|j|j  ddd|j |jjddy#1swY xYw#1swYxYw#1swYDxYw#1swYxYw#1swYfxYw) zp The `--create` flag can't be mixed with --patch, --rc, --post, --dev, or --newversion. r NTFr5rzOnly give --createrr}rs rtest_no_mix_createz%CreatedUpdateTests.test_no_mix_createsv    z * a ii zz   ))!,.BC   z * a ii zz   ))!,.BC   z * a ii zz   ))!,.BC   z * a ii zz   ))!,.BC   z * a ii zz   ))!,.BC]          s;5I+5I85J 5J5J+I58JJJJ'c Tg}tdddddddd|j|j|j |j |j j djd|j |j j djd y) z `incremental.update package --newversion=1.2.3.rc1.post2.dev3`, will set that version in the package. r Nz1.2.3.rc1.post2.dev3Fr5r4s0""" 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, post=2, dev=3) __all__ = ["__version__"] rs from incremental import Version introduced_in = Version("inctestpkg", 1, 2, 3, release_candidate=1, post=2, dev=3).short() next_released_version = "inctestpkg 1.2.3.rc1.post2.dev3" rlrFs rtest_newversionz"CreatedUpdateTests.test_newversion s  -))KK::   OO ! !- 0 ; ; =   OO ! !- 0 ; ; = rc Tg}tdddddddd|j|j|j |j |j j djd|j |j j djd y) zl `incremental.update package --newversion=1`, will set that version in the package. r NrFr5r4s """ 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" rlrFs rtest_newversion_barez'CreatedUpdateTests.test_newversion_bare<s  ))KK::   OO ! !- 0 ; ; =    OO ! !- 0 ; ; =  rc Tg}tdddddddd|j|j|j |j |j j djd|j |j j djd y) zn `incremental.update package --newversion=1.1`, will set that version in the package. r Nz1.1Fr5r4s """ 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, 1, 0) __all__ = ["__version__"] rs from incremental import Version introduced_in = Version("inctestpkg", 1, 1, 0).short() next_released_version = "inctestpkg 1.1.0" rlrFs r test_newversion_bare_major_minorz3CreatedUpdateTests.test_newversion_bare_major_minorhs  ))KK::   OO ! !- 0 ; ; =    OO ! !- 0 ; ; =  r)r r!r"maxDiffr2rTrirmrqrsruryr{rrrrrrrrrrr%rrrbrbs|G>" H" H) V* X* X2 h3 jP d 4" H* X2 hDHL3AjTDl. `* X* rrbceZdZdZdZdZy) ScriptTestsc8tj_jjjj djjj dj d}|j|j dj d|j dj dfd_|_Gdd tGfd d t}|_ y) NrYr rrr4rMc0jjSrrrsrrz#ScriptTests.setUp..rrceZdZdZdZy)ScriptTests.setUp..DaterrNrr%rrr&rr'rr&ceZdZfdZy)%ScriptTests.setUp..DateModulecSrr%)rr&s rtodayz+ScriptTests.setUp..DateModule.todays v rN)r r!r"r)r&sr DateModulers rrr()rr.rr&s` @rr2zScriptTests.setUpst{{}-   % ))+[[&&u-33LA '22   '22  / $ 6   L rcDt}|jtd||jt5}t dgddd|j jjdd|jd|jy#1swYSxYw)I Calling run() with no args will cause it to print help. stdoutz--helpNrzShow this message and exit) rr7sysrR SystemExitr rDr~rassertIngetvaluerstringiors rtest_runzScriptTests.test_runs"# 3(+   z * a  O  ))!,a0 2H4E4E4GH   s BBct}|jtd||jtd|j|jt d|j |jt5}tddgddd|jjjdd|jd|j|j|jj!d j#d |j|jj!d j#d y#1swYxYw) rrr-r0r z--rcNrzUpdating codebaser4rwrrx)rr7rosr-datetimer0rRrr rDr~rrrr.r+rErs rtest_insufficient_argsz"ScriptTests.test_insufficient_argss "# 3(+ 2x- 8VTYY/   z * (a v& ' ( ))!,a0 )8+<+<+>?  OO ! !- 0 ; ; =    OO ! !- 0 ; ; =  + ( (s 9E  EN)r r!r"r2rrr%rrrrs#!J I% rr)__doc__ __future__rrrrrtwisted.python.filepathrtwisted.python.compatrtwisted.trial.unittestrincremental.updaterr r rJrWrbrr%rrrsj1 ,0+(= H= @585pd hd N^ ^ BX (X r