コード例 #1
0
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")]
コード例 #2
0
ファイル: test_decision_tools.py プロジェクト: jupyter/nbdime
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")]
コード例 #3
0
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
コード例 #4
0
ファイル: test_decision_tools.py プロジェクト: jupyter/nbdime
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