示例#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