1import json23import pytest45from protocol import ProtocolError, parse_render_input678def _request(**updates):9 value = {'source': 'connectors: {}'}10 value.update(updates)11 return json.dumps(value)121314def test_protocol_normalizes_bounded_scalar_options():15 parsed = parse_render_input(_request(options={'FLAG': True, 'count': 2}))16 assert parsed.options == {'flag': 'true', 'count': '2'}171819def test_protocol_rejects_nested_or_unbounded_options():20 with pytest.raises(ProtocolError, match='must be a string, number, or boolean'):21 parse_render_input(_request(options={'bad': {'nested': True}}))22 with pytest.raises(ProtocolError, match='more than 64'):23 parse_render_input(_request(options={f'k{index}': index for index in range(65)}))