configtypes: Disallow ValidValues without values.
This commit is contained in:
parent
b863c9807b
commit
7761dd5af4
@ -79,6 +79,8 @@ class ValidValues:
|
||||
"""
|
||||
|
||||
def __init__(self, *vals):
|
||||
if not vals:
|
||||
raise ValueError("ValidValues with no values makes no sense!")
|
||||
self.descriptions = {}
|
||||
self.values = []
|
||||
for v in vals:
|
||||
|
@ -159,6 +159,10 @@ class TestValidValues:
|
||||
def test_repr(self, klass, args, expected):
|
||||
assert repr(klass(*args)) == expected
|
||||
|
||||
def test_empty(self, klass):
|
||||
with pytest.raises(ValueError):
|
||||
klass()
|
||||
|
||||
|
||||
class TestBaseType:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user