Clean up whitespaces

This commit is contained in:
erik 2023-03-03 15:07:02 +01:00
parent c76804ad92
commit 8c0ae19fdc
4 changed files with 9 additions and 9 deletions

View file

@ -5,7 +5,7 @@ class VersionRepository():
def __init__(self, file):
self.file = file
self.file_handler = None
self.file_handler = None
def load_file(self):
self.file_handler = FileHandler.from_file_path(self.file)
@ -21,7 +21,7 @@ class VersionRepository():
version_list, is_snapshot = self.file_handler.parse()
return version_list, is_snapshot
def get_version(self) -> Version:
def get_version(self) -> Version:
self.file_handler = self.load_file()
version_list, is_snapshot = self.parse_file()

View file

@ -20,17 +20,17 @@ class MockGitApi():
self.commit_count = 0
self.push_count = 0
def get_latest_n_commits(self, n: int):
def get_latest_n_commits(self, n: int):
return " "
def get_latest_commit(self):
return " "
def tag_annotated(self, annotation: str, message: str, count: int):
def tag_annotated(self, annotation: str, message: str, count: int):
self.tag_annotated_count += 1
return " "
def get_latest_tag(self):
def get_latest_tag(self):
return " "
def get_current_branch(self):

View file

@ -37,6 +37,6 @@ def test_git_api(tmp_path: Path, monkeypatch: pt.MonkeyPatch):
git_api.add_file(file_name)
git_api.commit("MINOR release")
# test
# test
latest_commit = git_api.get_latest_commit()
assert "MINOR release" in latest_commit

View file

@ -37,7 +37,7 @@ def test_prepare_release_service(): # todo: maybe use mocks for service api test
assert prepare_release_service.git_api.commit_count == 1
# init
prepare_release_service.write_and_commit_bump() #todo: add asserts
prepare_release_service.write_and_commit_bump()
# test
assert prepare_release_service.release.validate_count == 2
@ -48,10 +48,10 @@ def test_prepare_release_service(): # todo: maybe use mocks for service api test
def test_tag_and_push_release_service():
# init
mock_release_repo = MockReleaseRepository(MockVersionRepository(), MockReleaseTypeRepository(MockGitApi()), 'main')
tag_and_push_release_service = TagAndPushReleaseService(MockGitApi())
tag_and_push_release_service = TagAndPushReleaseService(MockGitApi())
tag_and_push_release_service.tag_release(mock_release_repo.get_release())
tag_and_push_release_service.push_release()
#test
assert tag_and_push_release_service.git_api.tag_annotated_count == 1
assert tag_and_push_release_service.git_api.push_count == 1
assert tag_and_push_release_service.git_api.push_count == 1