Clean up whitespaces
This commit is contained in:
parent
c76804ad92
commit
8c0ae19fdc
4 changed files with 9 additions and 9 deletions
|
@ -5,7 +5,7 @@ class VersionRepository():
|
||||||
|
|
||||||
def __init__(self, file):
|
def __init__(self, file):
|
||||||
self.file = file
|
self.file = file
|
||||||
self.file_handler = None
|
self.file_handler = None
|
||||||
|
|
||||||
def load_file(self):
|
def load_file(self):
|
||||||
self.file_handler = FileHandler.from_file_path(self.file)
|
self.file_handler = FileHandler.from_file_path(self.file)
|
||||||
|
@ -21,7 +21,7 @@ class VersionRepository():
|
||||||
version_list, is_snapshot = self.file_handler.parse()
|
version_list, is_snapshot = self.file_handler.parse()
|
||||||
return version_list, is_snapshot
|
return version_list, is_snapshot
|
||||||
|
|
||||||
def get_version(self) -> Version:
|
def get_version(self) -> Version:
|
||||||
|
|
||||||
self.file_handler = self.load_file()
|
self.file_handler = self.load_file()
|
||||||
version_list, is_snapshot = self.parse_file()
|
version_list, is_snapshot = self.parse_file()
|
||||||
|
|
|
@ -20,17 +20,17 @@ class MockGitApi():
|
||||||
self.commit_count = 0
|
self.commit_count = 0
|
||||||
self.push_count = 0
|
self.push_count = 0
|
||||||
|
|
||||||
def get_latest_n_commits(self, n: int):
|
def get_latest_n_commits(self, n: int):
|
||||||
return " "
|
return " "
|
||||||
|
|
||||||
def get_latest_commit(self):
|
def get_latest_commit(self):
|
||||||
return " "
|
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
|
self.tag_annotated_count += 1
|
||||||
return " "
|
return " "
|
||||||
|
|
||||||
def get_latest_tag(self):
|
def get_latest_tag(self):
|
||||||
return " "
|
return " "
|
||||||
|
|
||||||
def get_current_branch(self):
|
def get_current_branch(self):
|
||||||
|
|
|
@ -37,6 +37,6 @@ def test_git_api(tmp_path: Path, monkeypatch: pt.MonkeyPatch):
|
||||||
git_api.add_file(file_name)
|
git_api.add_file(file_name)
|
||||||
git_api.commit("MINOR release")
|
git_api.commit("MINOR release")
|
||||||
|
|
||||||
# test
|
# test
|
||||||
latest_commit = git_api.get_latest_commit()
|
latest_commit = git_api.get_latest_commit()
|
||||||
assert "MINOR release" in latest_commit
|
assert "MINOR release" in latest_commit
|
||||||
|
|
|
@ -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
|
assert prepare_release_service.git_api.commit_count == 1
|
||||||
|
|
||||||
# init
|
# init
|
||||||
prepare_release_service.write_and_commit_bump() #todo: add asserts
|
prepare_release_service.write_and_commit_bump()
|
||||||
|
|
||||||
# test
|
# test
|
||||||
assert prepare_release_service.release.validate_count == 2
|
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():
|
def test_tag_and_push_release_service():
|
||||||
# init
|
# init
|
||||||
mock_release_repo = MockReleaseRepository(MockVersionRepository(), MockReleaseTypeRepository(MockGitApi()), 'main')
|
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.tag_release(mock_release_repo.get_release())
|
||||||
tag_and_push_release_service.push_release()
|
tag_and_push_release_service.push_release()
|
||||||
|
|
||||||
#test
|
#test
|
||||||
assert tag_and_push_release_service.git_api.tag_annotated_count == 1
|
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
|
||||||
|
|
Loading…
Reference in a new issue