def test_enable(self): opt = get_options(["enable"]) assert opt.command == "enable"
def test_status(self): opt = get_options(["status"]) assert opt.command == "status"
def test_no_args(self): with pytest.raises(SystemExit): get_options(["credentials"])
def test_disable(self): opt = get_options(["disable"]) assert opt.command == "disable"
def test_no_username(self): with pytest.raises(SystemExit): get_options(["credentials", "-pass-"])
def test_ok_special(self): opt = get_options(["credentials", "--", "-user-", "-pass-"]) assert opt.command == "credentials" assert opt.username == "-user-" assert opt.password == "-pass-"
def test_ok_normal(self): opt = get_options(["credentials", "user", "pass"]) assert opt.command == "credentials" assert opt.username == "user" assert opt.password == "pass"
def test_with_argument(self): opt = get_options(["from-str", "some old string"]) assert opt.command == "from-str" assert opt.string == "some old string"
def modified_get_options(string: str): return get_options(string.split())