Make counters count up

This commit is contained in:
erik 2023-03-03 14:55:38 +01:00
parent 3f44148237
commit c76804ad92
3 changed files with 17 additions and 10 deletions

View file

@ -32,15 +32,16 @@ class MockRelease():
self.release_type = release_type
self.version = version
self.current_branch = current_branch
self.validate_count = 0
def release_version(self):
return MockVersion()
return self.version.create_release_version(self.release_type)
def bump_version(self):
return MockVersion()
return self.release_version().create_bump_version()
def validate(self, main_branch):
self.validate_count =+ 1
self.validate_count += 1
return self.is_valid
def is_valid(self, main_branch):

View file

@ -14,12 +14,13 @@ class MockVersionRepository():
def __init__(self):
self.file = None
self.file_handler = None
self.write_file_count = 0
def load_file(self):
pass
def write_file(self, version_string):
self.write_file_count =+ 1
self.write_file_count += 1
pass
def parse_file(self):
@ -40,7 +41,8 @@ class MockReleaseRepository():
self.version_repository = version_repository
self.release_type_repository = release_type_repository
self.main_branch = main_branch
self.get_release_count = 0
def get_release(self) -> MockRelease:
self.get_release_count =+ 1
self.get_release_count += 1
return MockRelease(self.release_type_repository.get_release_type(), self.version_repository.get_version(), self.main_branch)

View file

@ -15,6 +15,10 @@ class MockGitApi():
def __init__(self):
self.system_api = MockSystemAPI()
self.tag_annotated_count = 0
self.add_file_count = 0
self.commit_count = 0
self.push_count = 0
def get_latest_n_commits(self, n: int):
return " "
@ -23,7 +27,7 @@ class MockGitApi():
return " "
def tag_annotated(self, annotation: str, message: str, count: int):
self.tag_annotated_count =+ 1
self.tag_annotated_count += 1
return " "
def get_latest_tag(self):
@ -36,15 +40,15 @@ class MockGitApi():
pass
def add_file(self, file_path):
self.add_file_count =+ 1
self.add_file_count += 1
return " "
def commit(self, commit_message: str):
self.commit_count =+ 1
self.commit_count += 1
return commit_message
def push(self):
self.push_count =+ 1
self.push_count += 1
return " "
def checkout(self, branch: str):