Readd tests for python, clojure and json
This commit is contained in:
parent
bb17017583
commit
e9301dedd1
1 changed files with 54 additions and 0 deletions
|
@ -68,3 +68,57 @@ def test_gradle(tmp_path):
|
||||||
|
|
||||||
# check
|
# check
|
||||||
assert 'version = "12.4.678-SNAPSHOT"' in f.read_text()
|
assert 'version = "12.4.678-SNAPSHOT"' in f.read_text()
|
||||||
|
|
||||||
|
def test_json(tmp_path):
|
||||||
|
# init
|
||||||
|
file_name = 'config.json'
|
||||||
|
with open(f'test/resources/{file_name}', 'r') as gradle_file:
|
||||||
|
contents = gradle_file.read()
|
||||||
|
|
||||||
|
f = tmp_path / file_name
|
||||||
|
f.write_text(contents)
|
||||||
|
|
||||||
|
# test
|
||||||
|
version_repo = VersionRepository.get(f)
|
||||||
|
version_list = version_repo.version_list
|
||||||
|
version = Version.create_release_version(version_list, ReleaseType.SNAPSHOT)
|
||||||
|
version_repo.write_file(version.get_version_string())
|
||||||
|
|
||||||
|
# check
|
||||||
|
assert '"version": "123.123.456-SNAPSHOT"' in f.read_text()
|
||||||
|
|
||||||
|
def test_clojure(tmp_path):
|
||||||
|
# init
|
||||||
|
file_name = 'config.clj'
|
||||||
|
with open(f'test/resources/{file_name}', 'r') as gradle_file:
|
||||||
|
contents = gradle_file.read()
|
||||||
|
|
||||||
|
f = tmp_path / file_name
|
||||||
|
f.write_text(contents)
|
||||||
|
|
||||||
|
# test
|
||||||
|
version_repo = VersionRepository.get(f)
|
||||||
|
version_list = version_repo.version_list
|
||||||
|
version = Version.create_release_version(version_list, ReleaseType.SNAPSHOT)
|
||||||
|
version_repo.write_file(version.get_version_string())
|
||||||
|
|
||||||
|
# check
|
||||||
|
assert '1.1.3-SNAPSHOT' in f.read_text()
|
||||||
|
|
||||||
|
def test_python(tmp_path):
|
||||||
|
# init
|
||||||
|
file_name = 'config.py'
|
||||||
|
with open(f'test/resources/{file_name}', 'r') as gradle_file:
|
||||||
|
contents = gradle_file.read()
|
||||||
|
|
||||||
|
f = tmp_path / file_name
|
||||||
|
f.write_text(contents)
|
||||||
|
|
||||||
|
# test
|
||||||
|
version_repo = VersionRepository.get(f)
|
||||||
|
version_list = version_repo.version_list
|
||||||
|
version = Version.create_release_version(version_list, ReleaseType.SNAPSHOT)
|
||||||
|
version_repo.write_file(version.get_version_string())
|
||||||
|
|
||||||
|
# check
|
||||||
|
assert '3.1.3-SNAPSHOT' in f.read_text()
|
Loading…
Reference in a new issue