mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +01:00
Fix pycalver bump for mercurial repos
This commit is contained in:
parent
57aa1a2ae0
commit
fc36f31cb0
2 changed files with 31 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import io
|
||||
import time
|
||||
import shutil
|
||||
import pathlib2 as pl
|
||||
import subprocess as sp
|
||||
|
|
@ -34,11 +35,15 @@ requires = ["setuptools", "wheel"]
|
|||
def runner(tmpdir):
|
||||
runner = CliRunner()
|
||||
orig_cwd = os.getcwd()
|
||||
os.environ['GIT_AUTHOR_NAME' ] = "pycalver_tester"
|
||||
os.environ['GIT_AUTHOR_EMAIL'] = "pycalver_tester@nowhere.com"
|
||||
os.environ['HGUSER' ] = "pycalver_tester"
|
||||
|
||||
_debug = 0
|
||||
if _debug:
|
||||
tmpdir = pl.Path("..") / "tmp_test_pycalver_project"
|
||||
if tmpdir.exists():
|
||||
time.sleep(0.2)
|
||||
shutil.rmtree(str(tmpdir))
|
||||
tmpdir.mkdir()
|
||||
|
||||
|
|
@ -306,3 +311,20 @@ def test_git_bump(runner):
|
|||
with io.open("README.md") as fh:
|
||||
content = fh.read()
|
||||
assert calver + ".0002-alpha !\n" in content
|
||||
|
||||
|
||||
def test_hg_bump(runner):
|
||||
_add_project_files("README.md")
|
||||
_vcs_init("hg")
|
||||
|
||||
result = runner.invoke(pycalver.cli, ['init', "--verbose"])
|
||||
assert result.exit_code == 0
|
||||
|
||||
result = runner.invoke(pycalver.cli, ['bump', "--verbose"])
|
||||
assert result.exit_code == 0
|
||||
|
||||
calver = config._initial_version()[:7]
|
||||
|
||||
with io.open("README.md") as fh:
|
||||
content = fh.read()
|
||||
assert calver + ".0002-alpha !\n" in content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue