Skip to content

Commit

Permalink
Add test for installing from local repo
Browse files Browse the repository at this point in the history
  • Loading branch information
asdil12 committed Jun 2, 2023
1 parent 0104e2d commit ee9d954
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/05_install_from_local_repo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/python3

import sys
import pexpect
import subprocess

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

c.expect(r'([0-9]+)\. htop', timeout=10)
entry_id = c.match.groups()[0]
print("PEXPECT: Found entry id %r" % entry_id)
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("PEXPECT: Found entry id %r" % entry_id)
c.sendline(entry_id)

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

c.interact()
c.wait()
c.close()
print()
assert c.exitstatus == 0, 'Exit code: %i' % c.exitstatus

0 comments on commit ee9d954

Please sign in to comment.