dd todos from review
This commit is contained in:
parent
d5d8b8e7e1
commit
81458c6acc
3 changed files with 4 additions and 5 deletions
|
@ -22,13 +22,13 @@ def add_versions(config, release_version, bump_version) -> dict:
|
||||||
|
|
||||||
class ReleaseMixin(DevopsBuild):
|
class ReleaseMixin(DevopsBuild):
|
||||||
|
|
||||||
def __init__(self, project, config):
|
def __init__(self, project, config): # todo: create services in init, dont expose repos etc in api
|
||||||
super().__init__(project, config)
|
super().__init__(project, config)
|
||||||
release_mixin_config = config['ReleaseMixin']
|
release_mixin_config = config['ReleaseMixin']
|
||||||
self.config_file = release_mixin_config['config_file']
|
self.config_file = release_mixin_config['config_file']
|
||||||
self.main_branch = release_mixin_config['main_branch']
|
self.main_branch = release_mixin_config['main_branch']
|
||||||
self.git_api = GitApi()
|
self.git_api = GitApi()
|
||||||
self.release_type_repo = ReleaseTypeRepository(self.git_api)
|
self.release_type_repo = ReleaseTypeRepository(self.git_api) # maybe get from env?
|
||||||
self.version_repo = VersionRepository(self.config_file)
|
self.version_repo = VersionRepository(self.config_file)
|
||||||
self.release_repo = ReleaseRepository(self.version_repo, self.release_type_repo, self.main_branch)
|
self.release_repo = ReleaseRepository(self.version_repo, self.release_type_repo, self.main_branch)
|
||||||
|
|
||||||
|
|
|
@ -17,5 +17,4 @@ sys.path.append(parent)
|
||||||
# now we can import the module in the parent
|
# now we can import the module in the parent
|
||||||
# directory.
|
# directory.
|
||||||
|
|
||||||
from infrastructure_api import GitApi
|
from infrastructure_api import GitApi # todo: implement from services example
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ from infrastructure_api import GitApi
|
||||||
def change_test_dir( tmp_path: Path, monkeypatch: pt.MonkeyPatch):
|
def change_test_dir( tmp_path: Path, monkeypatch: pt.MonkeyPatch):
|
||||||
monkeypatch.chdir(tmp_path)
|
monkeypatch.chdir(tmp_path)
|
||||||
|
|
||||||
def test_prepare_release_service(tmp_path: Path, monkeypatch: pt.MonkeyPatch):
|
def test_prepare_release_service(tmp_path: Path, monkeypatch: pt.MonkeyPatch): # todo: maybe use mocks for service api tests
|
||||||
# init
|
# init
|
||||||
file_name = 'config.json'
|
file_name = 'config.json'
|
||||||
with open(f'test/resources/{file_name}', 'r') as json_file:
|
with open(f'test/resources/{file_name}', 'r') as json_file:
|
||||||
|
|
Loading…
Reference in a new issue