def test_required_value_with_default(): opt = Option("option", flag=False, requires_value=True, default="Default") assert not opt.is_flag() assert opt.accepts_value() assert opt.requires_value() assert not opt.is_list() assert "Default" == opt.default
def test_required_value(): opt = Option("option", flag=False, requires_value=True) assert not opt.is_flag() assert opt.accepts_value() assert opt.requires_value() assert not opt.is_list() assert opt.default is None
def test_multi_valued_with_default(): opt = Option("option", flag=False, is_list=True, default=["foo", "bar"]) assert not opt.is_flag() assert opt.accepts_value() assert opt.requires_value() assert opt.is_list() assert ["foo", "bar"] == opt.default
def test_list(): opt = Option("option", flag=False, is_list=True) assert not opt.is_flag() assert opt.accepts_value() assert opt.requires_value() assert opt.is_list() assert [] == opt.default
def test_create(): opt = Option("option") assert "option" == opt.name assert opt.shortcut is None assert opt.is_flag() assert not opt.accepts_value() assert not opt.requires_value() assert not opt.is_list() assert not opt.default