def get_rdict(left, right=None): """Check+transform left=right into a nested dict. left can be key, [key], [key1]key2, [key1][key2], [key1][key2]key3, etc. """ if left == "inherit": raise UserInputError( "Inheritance cannot be changed by broadcast") rdict = {} cur_dict = rdict tail = left while tail: match = REC_ITEM.match(tail) if match: sect, tail = match.groups() if tail: # [sect]... = right cur_dict[sect.strip()] = {} cur_dict = cur_dict[sect.strip()] else: # [sect] = right cur_dict[sect.strip()] = right else: # item = right cur_dict[tail.strip()] = right tail = None upg({'runtime': {'__MANY__': rdict}}, 'test') cylc_config_validate(rdict, SPEC['runtime']['__MANY__']) return rdict
def test_upgrade_max_active_cycle_points(macp, rlim): """Test that `max active cycle points` is correctly upgraded to `runahead limit`.""" cfg = { 'scheduling': {'max active cycle points': macp} } expected = { 'scheduling': {'runahead limit': rlim} } upg(cfg, 'flow.cylc') assert cfg == expected