From a03eef21f82f5895bbf306b39429c3a418e71108 Mon Sep 17 00:00:00 2001 From: nobkd <44443899+nobkd@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:51:50 +0200 Subject: [PATCH] test: add multi-install test --- test/05_install_from_local_repo.py | 1 - test/07_install_multiple.py | 38 ++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 test/07_install_multiple.py diff --git a/test/05_install_from_local_repo.py b/test/05_install_from_local_repo.py index f2afb49..720f356 100755 --- a/test/05_install_from_local_repo.py +++ b/test/05_install_from_local_repo.py @@ -2,7 +2,6 @@ import sys import pexpect -import subprocess c = pexpect.spawn('./bin/opi htop', logfile=sys.stdout.buffer, echo=False) diff --git a/test/07_install_multiple.py b/test/07_install_multiple.py new file mode 100644 index 0000000..47a4ad5 --- /dev/null +++ b/test/07_install_multiple.py @@ -0,0 +1,38 @@ +#!/usr/bin/python3 + +import sys +import pexpect +import subprocess + +c = pexpect.spawn('./bin/opi -m zsh sublime', logfile=sys.stdout.buffer, echo=False) + +# plugins (sublime) are installed first +c.expect('Do you want to install') +c.sendline('y') + +c.expect('Import package signing key', timeout=10) +c.sendline('y') + +c.expect('Continue') +c.sendline('y') + +c.expect('Do you want to keep', timeout=500) +c.sendline('y') + +# packages (zsh) come after plugins +c.expect(r'([0-9]+)\. zsh', timeout=10) +c.expect('Pick a number') +c.expect(r'([0-9]+)\. [^ ]*(openSUSE-Tumbleweed-Oss|Main Repository)', timeout=10) +c.expect('Installing from existing repo', timeout=10) +c.expect('Continue?', timeout=20) +c.interact() + +c.wait() +c.close() +print() +assert c.exitstatus == 0, f'Exit code: {c.exitstatus}' + +subprocess.check_call(['rpm', '-qi', 'sublime-text']) +subprocess.check_call('zypper lr | grep sublime-text', shell=True) + +subprocess.check_call(['rpm', '-qi', 'zsh'])