dda-devops-build/src/main/python/ddadevops/release-mixin/test/mock_infrastructure_api.py

52 lines
1 KiB
Python
Raw Normal View History

2023-03-03 12:31:51 +00:00
class MockSystemAPI():
def __init__(self):
self.stdout = [""]
self.stderr = [""]
def run(self, args):
pass
def run_checked(self, *args):
self.run(args)
pass
class MockGitApi():
def __init__(self):
self.system_api = MockSystemAPI()
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):
self.tag_annotated_count =+ 1
return " "
def get_latest_tag(self):
return " "
def get_current_branch(self):
return " "
def init(self):
pass
def add_file(self, file_path):
self.add_file_count =+ 1
return " "
def commit(self, commit_message: str):
self.commit_count =+ 1
return commit_message
def push(self):
self.push_count =+ 1
return " "
def checkout(self, branch: str):
return " "