integration_tests.test_packages_update(): use switch_branch=True and check if branch successfully switched

This commit is contained in:
InsanePrawn 2022-09-22 07:10:53 +02:00
parent 4fc45bf098
commit 0c70d6ec59

View file

@ -29,15 +29,17 @@ def ctx() -> click.Context:
def test_packages_update(ctx: click.Context): def test_packages_update(ctx: click.Context):
kbs_branch = git_get_branch(config.runtime.script_source_dir) kbs_branch = git_get_branch(config.runtime.script_source_dir)
pkgbuilds_path = config.get_path('pkgbuilds')
for branch, may_fail in {'main': False, 'dev': False, kbs_branch: True}.items(): for branch, may_fail in {'main': False, 'dev': False, kbs_branch: True}.items():
config.file.pkgbuilds.git_branch = branch config.file.pkgbuilds.git_branch = branch
try: try:
ctx.invoke(cmd_update, non_interactive=True) ctx.invoke(cmd_update, non_interactive=True, switch_branch=True)
print("WOULD CTX INVOKE UPDATE HERE")
except Exception as ex: except Exception as ex:
print(f'may_fail: {may_fail}; Exception: {ex}')
if not may_fail: if not may_fail:
print(f'Exception: {ex}') raise ex
assert may_fail continue
assert git_get_branch(pkgbuilds_path) == branch
def test_packages_clean(ctx: click.Context): def test_packages_clean(ctx: click.Context):