def test_invert_remove_via_update(): r = dotted.update({'hello': { 'there': 'me', 'not': 'this' }}, '-hello.there', dotted.ANY) assert r == {'hello': {'not': 'this'}}
def test_numeric_update(): m = dotted.update({}, '07a', 8) assert m == {'07a': 8}
def test_slice_upsert(): m = dotted.update([], '[:]', ['hello']) assert m == ['hello']
def test_slice_append(): m = dotted.update(['hello', 'there'], '[+:]', ['bye']) assert m == ['hello', 'there', 'bye']
def test_slice_prepend(): m = dotted.update(['hello', 'there'], '[:0]', ['bye']) assert m == ['bye', 'hello', 'there']
def test_slice_default(): m = dotted.update({}, 'stuff[]', ['bye']) assert m == {'stuff': ['bye']}
def test_appender_nested_if(): m = dotted.update({}, 'hello[+?].name', 'Hello') assert m == {'hello': [{'name': 'Hello'}]} m = dotted.update(m, 'hello[+?].name', 'Hello') assert m == {'hello': [{'name': 'Hello'}]}
def test_appender_flat_if(): m = dotted.update({}, 'hello.there[+?]', 9) assert m == {'hello': {'there': [9]}} m = dotted.update(m, 'hello.there[+?]', 9) assert m == {'hello': {'there': [9]}}
def test_appender_embedded(): m = dotted.update({'hello': {'there': 7}}, 'hello.list[+]', 9) assert m == {'hello': {'there': 7, 'list': [9]}}
def test_appender_nested_from_non_empty(): m = dotted.update({'hello': [{'name': 'Hello'}]}, 'hello[+].name', 'Bye') assert m == {'hello': [{'name': 'Hello'}, {'name': 'Bye'}]}
def test_appender_flat_str(): m = dotted.update('', '[+]', '1') assert m == '1'