manage callback with unrestraint
This commit is contained in:
@ -1298,6 +1298,21 @@ async def test_callback_calculating_invalid():
|
||||
assert not await list_sessions()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_callback_unrestraint():
|
||||
opt1 = IntOption('opt1', '', 1)
|
||||
opt2 = IntOption('opt2', '', Calculation(return_value, Params(ParamOption(opt1))))
|
||||
od1 = OptionDescription('od1', '', [opt1], properties=('disabled',))
|
||||
od2 = OptionDescription('od2', '', [opt2])
|
||||
maconfig = OptionDescription('rootconfig', '', [od1, od2])
|
||||
async with await Config(maconfig) as cfg:
|
||||
await cfg.property.read_write()
|
||||
with pytest.raises(ConfigError):
|
||||
await cfg.option('od2.opt2').value.get()
|
||||
assert await cfg.unrestraint.option('od2.opt2').value.get() == 1
|
||||
assert not await list_sessions()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_callback_calculating_disabled():
|
||||
opt1 = BoolOption('opt1', '', properties=('disabled',))
|
||||
|
Reference in New Issue
Block a user