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 3dbf1f6
Show file tree
Hide file tree
Showing 2 changed files with 44 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
44 changes: 44 additions & 0 deletions test/07_install_multiple.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/python3

import sys
import pexpect
import subprocess

c = pexpect.spawn('./bin/opi -m android-tools yandex-disk', logfile=sys.stdout.buffer, echo=False)

# plugins 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 come after plugins
c.expect(r'([0-9]+)\. android-tools', timeout=10)
entry_id = c.match.groups()[0]
print(f'PEXPECT: Found entry id {entry_id!r}')
c.expect('Pick a number')
c.sendline(entry_id)

c.expect(r'([0-9]+)\. [^ ]*(openSUSE-Tumbleweed-Oss|Main Repository)', timeout=10)
entry_id = c.match.groups()[0]
print(f'PEXPECT: Found entry id {entry_id!r}')
c.sendline(entry_id)

c.expect('Installing from existing repo', timeout=10)
c.expect('Continue?', timeout=20)
c.sendline('y')

c.interact()
c.wait()
c.close()
print()
assert c.exitstatus == 0, f'Exit code: {c.exitstatus}'
subprocess.check_call(['rpm', '-qi', 'yandex-disk'])
subprocess.check_call(['rpm', '-qi', 'android-tools'])

0 comments on commit 3dbf1f6

Please sign in to comment.