mandatory master/slave's consistency with default value as slave
This commit is contained in:
@ -287,6 +287,23 @@ def test_consistency_network_netmask_multi():
|
||||
raises(ValueError, "c.a = ['192.168.1.1']")
|
||||
|
||||
|
||||
def test_consistency_network_netmask_multi_slave_default():
|
||||
a = NetworkOption('a', '', multi=True, properties=('mandatory',))
|
||||
b = NetmaskOption('b', '', default_multi=u'255.255.255.0', multi=True, properties=('mandatory',))
|
||||
od = OptionDescription('a', '', [a, b])
|
||||
od.impl_set_group_type(groups.master)
|
||||
b.impl_add_consistency('network_netmask', a)
|
||||
c = Config(od)
|
||||
c.read_write()
|
||||
c.cfgimpl_get_settings().remove('cache')
|
||||
assert c.a == []
|
||||
assert c.b == []
|
||||
c.a.append(u'192.168.1.0')
|
||||
c.read_only()
|
||||
assert c.a == [u'192.168.1.0']
|
||||
assert c.b == [u'255.255.255.0']
|
||||
|
||||
|
||||
def test_consistency_ip_netmask_multi_master():
|
||||
a = IPOption('a', '', multi=True)
|
||||
b = NetmaskOption('b', '', multi=True)
|
||||
|
Reference in New Issue
Block a user