def test_pack_data(): data = {'x': 1} assert pack_data(('x', 'y'), data) == (1, 'y') data = {b'x': 1} assert pack_data((b'x', 'y'), data) == (1, 'y') assert pack_data({'a': b'x', 'b': 'y'}, data) == {'a': 1, 'b': 'y'} assert pack_data({'a': [b'x'], 'b': 'y'}, data) == {'a': [1], 'b': 'y'}
def test_pack_data(): data = {'x': 1} assert pack_data(('x', 'y'), data) == (1, 'y') data = {b'x': 1} assert pack_data((b'x', 'y'), data) == (1, 'y') assert pack_data({'a': b'x', 'b': 'y'}, data) == {'a': 1, 'b': 'y'} assert pack_data({'a': [b'x'], 'b': 'y'}, data) == {'a': [1], 'b': 'y'}
def test_pack_data_with_key_mapping(): data = {tokey(('x', 1)): 1} assert pack_data((('x', 1), 'y'), data) == (1, 'y')
def test_pack_data_with_key_mapping(): data = {tokey(('x', 1)): 1} assert pack_data((('x', 1), 'y'), data) == (1, 'y')
def test_pack_data(): data = {"x": 1} assert pack_data(("x", "y"), data) == (1, "y") assert pack_data({"a": "x", "b": "y"}, data) == {"a": 1, "b": "y"} assert pack_data({"a": ["x"], "b": "y"}, data) == {"a": [1], "b": "y"}