mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +01:00
Add tests for default pattern
This commit is contained in:
parent
db64264c91
commit
fa485b2e61
2 changed files with 28 additions and 0 deletions
6
test/fixtures/project_c/pyproject.toml
vendored
Normal file
6
test/fixtures/project_c/pyproject.toml
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
[pycalver]
|
||||||
|
current_version = "v2017q1.54321"
|
||||||
|
version_pattern = "v{year}q{quarter}.{build_no}"
|
||||||
|
commit = true
|
||||||
|
tag = true
|
||||||
|
push = true
|
||||||
|
|
@ -212,6 +212,28 @@ def test_parse_toml_file(tmpdir):
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def test_parse_default_pattern(tmpdir):
|
||||||
|
project_path = util.FIXTURES_DIR / "project_c"
|
||||||
|
config_path = util.FIXTURES_DIR / "project_c" / "pyproject.toml"
|
||||||
|
|
||||||
|
ctx = config.init_project_ctx(project_path)
|
||||||
|
|
||||||
|
assert ctx == config.ProjectContext(project_path, config_path, "toml", None)
|
||||||
|
|
||||||
|
cfg = config.parse(ctx)
|
||||||
|
|
||||||
|
assert cfg
|
||||||
|
|
||||||
|
assert cfg.current_version == "v2017q1.54321"
|
||||||
|
assert cfg.commit is True
|
||||||
|
assert cfg.tag is True
|
||||||
|
assert cfg.push is True
|
||||||
|
|
||||||
|
assert cfg.file_patterns == {
|
||||||
|
"pyproject.toml": [r'current_version = "v{year}q{quarter}.{build_no}"']
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def test_parse_cfg_file(tmpdir):
|
def test_parse_cfg_file(tmpdir):
|
||||||
project_path = tmpdir.mkdir("minimal")
|
project_path = tmpdir.mkdir("minimal")
|
||||||
setup_cfg = project_path.join("setup.cfg")
|
setup_cfg = project_path.join("setup.cfg")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue