def test_parse_parameters_response_with_conversions(): converters = {'y': int, 'z': lambda s: [int(v) for v in s.split(',')]} parsed = utils.parse_parameters_response('x:=1\ny==2\nz=3,4', converters=converters) assert parsed['x'] == '1' assert parsed['y'] == 2 assert parsed['z'] == [3, 4]
def test_parse_parameters_response_with_conversions(): converters = { 'y': int, 'z': lambda s: [int(v) for v in s.split(',')] } parsed = utils.parse_parameters_response('x:=1\ny==2\nz=3,4', converters=converters) assert parsed['x'] == '1' assert parsed['y'] == 2 assert parsed['z'] == [3, 4]
def test_parse_parameters_response_raises_exception(): with pytest.raises(exceptions.UnexpectedResponse): utils.parse_parameters_response('blerg')
def test_parse_parameters_response(): parsed = utils.parse_parameters_response('x:=1\ny==2\nz=3') assert parsed['x'] == '1' assert parsed['y'] == '2' assert parsed['z'] == '3'
def test_parse_parameters_response_raises_exception(): with pytest.raises(exceptions.UnexpectedResponse): utils.parse_parameters_response('blerg')
def test_parse_parameters_response(): parsed = utils.parse_parameters_response('x:=1\ny==2\nz=3') assert parsed['x'] == '1' assert parsed['y'] == '2' assert parsed['z'] == '3'