def test_pop_patch_multilevel(): md = MergeDecision( common_path=("a", "b"), action="base", conflict=True, local_diff=[op_patch("c", [op_patch("d", [op_remove("e")])])], remote_diff=[op_patch("c", [op_patch("d", [op_remove("f")])])]) dec = pop_patch_decision(md) dec = pop_patch_decision(dec) assert dec.common_path == ("a", "b", "c", "d") assert dec.local_diff == [op_remove("e")] assert dec.remote_diff == [op_remove("f")]
def test_pop_patch_multilevel(): md = MergeDecision( common_path=("a", "b"), action="base", conflict=True, local_diff=[op_patch("c", [op_patch("d", [op_remove("e")])])], remote_diff=[op_patch("c", [op_patch("d", [op_remove("f")])])] ) dec = pop_patch_decision(md) dec = pop_patch_decision(dec) assert dec.common_path == ("a", "b", "c", "d") assert dec.local_diff == [op_remove("e")] assert dec.remote_diff == [op_remove("f")]
def test_pop_patch_unpoppable(): md = MergeDecision(common_path=("a", "b"), action="base", conflict=True, local_diff=[op_remove("c")], remote_diff=[op_patch("c", [op_remove("d")])]) dec = pop_patch_decision(md) assert dec is None
def test_pop_patch_unpoppable(): md = MergeDecision( common_path=("a", "b"), action="base", conflict=True, local_diff=[op_remove("c")], remote_diff=[op_patch("c", [op_remove("d")])] ) dec = pop_patch_decision(md) assert dec is None