Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update github-runner tests #206

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions tests/test_oiejq.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,23 @@ def test_install_oiejq():
if sys.platform != 'linux':
return

shutil.rmtree(os.path.expanduser('~/.local/bin/'), ignore_errors=True)
try:
os.remove(os.path.expanduser('~/.local/bin/oiejq'))
os.remove(os.path.expanduser('~/.local/bin/sio2jail'))
except IsADirectoryError:
shutil.rmtree(os.path.expanduser('~/.local/bin/oiejq'), ignore_errors=True)
except FileNotFoundError:
pass
assert not oiejq.check_oiejq()
assert oiejq.install_oiejq()
assert oiejq.get_oiejq_path() == os.path.expanduser('~/.local/bin/oiejq')

shutil.rmtree(os.path.expanduser('~/.local/bin/'), ignore_errors=True)
try:
os.remove(os.path.expanduser('~/.local/bin/oiejq'))
os.remove(os.path.expanduser('~/.local/bin/sio2jail'))
except FileNotFoundError:
pass

assert not oiejq.check_oiejq()
os.makedirs(os.path.expanduser('~/.local/bin/oiejq'))
with pytest.raises(SystemExit):
Expand All @@ -28,7 +39,14 @@ def test_check_oiejq():
if sys.platform != 'linux':
return

shutil.rmtree(os.path.expanduser('~/.local/bin/'), ignore_errors=True)
try:
os.remove(os.path.expanduser('~/.local/bin/oiejq'))
os.remove(os.path.expanduser('~/.local/bin/sio2jail'))
except IsADirectoryError:
shutil.rmtree(os.path.expanduser('~/.local/bin/oiejq'), ignore_errors=True)
except FileNotFoundError:
pass

assert not oiejq.check_oiejq()
os.makedirs(os.path.expanduser('~/.local/bin/oiejq'), exist_ok=True)
assert not oiejq.check_oiejq()
Expand Down
Loading