coverage
This commit is contained in:
@ -39,6 +39,11 @@ def test_multi_unique():
|
||||
c.int.extend([4, 5, 6])
|
||||
|
||||
|
||||
def test_non_valid_multi():
|
||||
raises(ValueError, "IntOption('int', '', multi='string')")
|
||||
raises(ValueError, "IntOption('int', '', multi=True, unique='string')")
|
||||
|
||||
|
||||
def test_non_multi_unique():
|
||||
raises(ValueError, "IntOption('int', '', unique=True)")
|
||||
|
||||
|
@ -6,11 +6,15 @@ from py.test import raises
|
||||
from tiramisu.setting import owners, groups
|
||||
from tiramisu.config import Config
|
||||
from tiramisu.option import IPOption, NetworkOption, NetmaskOption, IntOption,\
|
||||
BroadcastOption, SymLinkOption, OptionDescription, submulti
|
||||
BroadcastOption, StrOption, SymLinkOption, OptionDescription, submulti
|
||||
from tiramisu.error import ConfigError, ValueWarning, PropertiesOptionError
|
||||
import warnings
|
||||
|
||||
|
||||
def return_value(value=None):
|
||||
return value
|
||||
|
||||
|
||||
def test_consistency():
|
||||
a = IntOption('a', '')
|
||||
b = IntOption('b', '')
|
||||
@ -67,9 +71,15 @@ def test_consistency_warnings_only_more_option():
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
c.b = 1
|
||||
assert w != []
|
||||
assert len(w) == 1
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
c.d
|
||||
assert w != []
|
||||
assert len(w) == 1
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
c.d = 1
|
||||
assert w != []
|
||||
assert len(w) == 1
|
||||
|
||||
|
||||
def test_consistency_not_equal():
|
||||
|
Reference in New Issue
Block a user