2021-05-21 15:17:47 +02:00
|
|
|
import pytest
|
|
|
|
from humblebundle_downloader.cli import parse_args
|
|
|
|
|
|
|
|
|
|
|
|
def test_old_action_format():
|
|
|
|
with pytest.raises(DeprecationWarning):
|
2024-08-01 01:59:58 +02:00
|
|
|
_ = parse_args(["download", "-l", "some_path", "-c", "fake_cookie"])
|
2021-05-21 15:17:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_no_action():
|
2024-08-01 01:59:58 +02:00
|
|
|
args = parse_args(["-l", "some_path", "-c", "fake_cookie"])
|
|
|
|
assert args.library_path == "some_path"
|
|
|
|
assert args.cookie_file == "fake_cookie"
|
2021-11-20 11:12:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_no_args():
|
|
|
|
with pytest.raises(SystemExit) as ex:
|
|
|
|
parse_args([])
|
|
|
|
assert ex.value.code == 2
|