Fix typos, remove old todos
This commit is contained in:
bom 2023-11-17 14:45:38 +01:00
parent 617d909438
commit 36df9f486b
5 changed files with 12 additions and 13 deletions

View file

@ -116,7 +116,6 @@ class BuildFile(Validateable):
) )
self.content = substitute self.content = substitute
case BuildFileType.JAVA_CLOJURE: case BuildFileType.JAVA_CLOJURE:
# TODO: we should stick here on defproject instead of first line!
substitute = re.sub( substitute = re.sub(
self.__get_file_type_regex_str(build_file_type), self.__get_file_type_regex_str(build_file_type),
fr'\g<project>"{new_version.to_string()}"', fr'\g<project>"{new_version.to_string()}"',

View file

@ -13,7 +13,7 @@ from src.test.python.domain.helper import (
from src.main.python.ddadevops.application import ReleaseService from src.main.python.ddadevops.application import ReleaseService
def test_sould_update_release_type(): def test_should_update_release_type():
sut = ReleaseService( sut = ReleaseService(
GitApiMock(), ArtifactDeploymentApiMock(), BuildFileRepositoryMock("build.py") GitApiMock(), ArtifactDeploymentApiMock(), BuildFileRepositoryMock("build.py")
) )
@ -26,7 +26,7 @@ def test_sould_update_release_type():
sut.update_release_type(release, "NOT_EXISTING") sut.update_release_type(release, "NOT_EXISTING")
def test_sould_publish_artifacts(): def test_should_publish_artifacts():
mock = ArtifactDeploymentApiMock(release='{"id": 2345}') mock = ArtifactDeploymentApiMock(release='{"id": 2345}')
sut = ReleaseService(GitApiMock(), mock, BuildFileRepositoryMock()) sut = ReleaseService(GitApiMock(), mock, BuildFileRepositoryMock())
devops = build_devops( devops = build_devops(
@ -41,7 +41,7 @@ def test_sould_publish_artifacts():
sut.publish_artifacts(release) sut.publish_artifacts(release)
assert "http://repo.test/api/v1/repos/orga/repo/releases/2345/assets" == mock.add_asset_to_release_api_endpoint assert "http://repo.test/api/v1/repos/orga/repo/releases/2345/assets" == mock.add_asset_to_release_api_endpoint
def test_sould_throw_exception_if_there_was_an_error_in_publish_artifacts(): def test_should_throw_exception_if_there_was_an_error_in_publish_artifacts():
devops = build_devops( devops = build_devops(
{ {
"release_artifacts": ["target/art"], "release_artifacts": ["target/art"],

View file

@ -13,7 +13,7 @@ from src.main.python.ddadevops.domain import (
from .helper import build_devops, devops_config from .helper import build_devops, devops_config
def test_sould_validate_release(): def test_should_validate_release():
sut = Artifact("x") sut = Artifact("x")
assert sut.is_valid() assert sut.is_valid()

View file

@ -7,7 +7,7 @@ from src.main.python.ddadevops.domain import (
) )
def test_sould_validate_build_file(): def test_should_validate_build_file():
sut = BuildFile(Path("./project.clj"), "content") sut = BuildFile(Path("./project.clj"), "content")
assert sut.is_valid() assert sut.is_valid()
@ -18,7 +18,7 @@ def test_sould_validate_build_file():
assert not sut.is_valid() assert not sut.is_valid()
def test_sould_calculate_build_type(): def test_should_calculate_build_type():
sut = BuildFile(Path("./project.clj"), "content") sut = BuildFile(Path("./project.clj"), "content")
assert sut.build_file_type() == BuildFileType.JAVA_CLOJURE assert sut.build_file_type() == BuildFileType.JAVA_CLOJURE
@ -29,7 +29,7 @@ def test_sould_calculate_build_type():
assert sut.build_file_type() == BuildFileType.JS assert sut.build_file_type() == BuildFileType.JS
def test_sould_parse_and_set_js(): def test_should_parse_and_set_js():
sut = BuildFile( sut = BuildFile(
Path("./package.json"), Path("./package.json"),
""" """
@ -77,7 +77,7 @@ def test_sould_parse_and_set_js():
) )
def test_sould_parse_and_set_version_for_gradle(): def test_should_parse_and_set_version_for_gradle():
sut = BuildFile( sut = BuildFile(
Path("./build.gradle"), Path("./build.gradle"),
""" """
@ -97,7 +97,7 @@ version = "1.1.5-SNAPSHOT"
assert '\nversion = "2.0.0"\n' == sut.content assert '\nversion = "2.0.0"\n' == sut.content
def test_sould_parse_and_set_version_for_py(): def test_should_parse_and_set_version_for_py():
sut = BuildFile( sut = BuildFile(
Path("./build.py"), Path("./build.py"),
""" """
@ -143,7 +143,7 @@ version = "1.1.5-SNAPSHOT"
assert '\nversion = "2.0.0"\n' == sut.content assert '\nversion = "2.0.0"\n' == sut.content
def test_sould_parse_and_set_version_for_clj(): def test_should_parse_and_set_version_for_clj():
sut = BuildFile( sut = BuildFile(
Path("./project.clj"), Path("./project.clj"),
""" """

View file

@ -15,7 +15,7 @@ from src.main.python.ddadevops.domain import (
from .helper import build_devops, devops_config from .helper import build_devops, devops_config
def test_sould_validate_release(): def test_should_validate_release():
sut = Release( sut = Release(
devops_config( devops_config(
{ {
@ -49,7 +49,7 @@ def test_sould_validate_release():
assert not sut.is_valid() assert not sut.is_valid()
def test_sould_calculate_build_files(): def test_should_calculate_build_files():
sut = Release( sut = Release(
devops_config( devops_config(
{ {