예제 #1
0
def test_parse_action_replace_is_default(mocker):
    m = mocker.Mock(attributes={})
    assert parse_action(m) == replace
예제 #2
0
def test_parse_action_edit_append(mocker):
    m = mocker.Mock(attributes={"edit": "append"})
    assert parse_action(m) == edit_append
예제 #3
0
def test_parse_action_invalid_edit(mocker):
    m = mocker.Mock(attributes={"edit": "replace"})
    with pytest.raises(TerminalXMLParseError):
        parse_action(m)
예제 #4
0
def test_parse_action_invalid(mocker):
    m = mocker.Mock(attributes={"action": "add"})
    with pytest.raises(TerminalXMLParseError):
        parse_action(m)
예제 #5
0
def test_parse_action_merge(mocker):
    m = mocker.Mock(attributes={"action": "merge"})
    assert parse_action(m) == merge
예제 #6
0
def test_parse_action_delete(mocker):
    m = mocker.Mock(attributes={"action": "delete"})
    assert parse_action(m) == delete
예제 #7
0
def test_parse_action_append(mocker):
    m = mocker.Mock(attributes={"action": "append"})
    assert parse_action(m) == append
예제 #8
0
def test_parse_action_replace(mocker):
    m = mocker.Mock(attributes={"action": "replace"})
    assert parse_action(m) == replace