Skip to content

Commit

Permalink
test: add multi-install test
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Oct 10, 2023
1 parent 1577694 commit a03eef2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
1 change: 0 additions & 1 deletion test/05_install_from_local_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import sys
import pexpect
import subprocess

c = pexpect.spawn('./bin/opi htop', logfile=sys.stdout.buffer, echo=False)

Expand Down
38 changes: 38 additions & 0 deletions test/07_install_multiple.py
Original file line number Diff line number Diff line change
@@ -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'])

0 comments on commit a03eef2

Please sign in to comment.