コード例 #1
0
ファイル: test_remote_sync.py プロジェクト: caitp/inbox
def test_merge(config):
    """Test the basic logic of the merge() function."""
    base = Contact(name='Original Name',
                   email_address='*****@*****.**')
    remote = Contact(name='New Name',
                     email_address='*****@*****.**')
    dest = Contact(name='Original Name',
                   email_address='*****@*****.**')
    merge(base, remote, dest)
    assert dest.name == 'New Name'
    assert dest.email_address == '*****@*****.**'
コード例 #2
0
ファイル: test_remote_sync.py プロジェクト: caitp/inbox
def test_merge(config):
    """Test the basic logic of the merge() function."""
    base = Contact(name='Original Name',
                   email_address='*****@*****.**')
    remote = Contact(name='New Name',
                     email_address='*****@*****.**')
    dest = Contact(name='Original Name',
                   email_address='*****@*****.**')
    merge(base, remote, dest)
    assert dest.name == 'New Name'
    assert dest.email_address == '*****@*****.**'
コード例 #3
0
ファイル: test_remote_sync.py プロジェクト: caitp/inbox
def test_merge_conflict(config):
    """Test that merge() raises an error on conflict."""
    base = Contact(name='Original Name',
                   email_address='*****@*****.**')
    remote = Contact(name='New Name',
                     email_address='*****@*****.**')
    dest = Contact(name='Some Other Name',
                   email_address='*****@*****.**')
    with pytest.raises(MergeError):
        merge(base, remote, dest)

    # Check no update in case of conflict
    assert dest.name == 'Some Other Name'
    assert dest.email_address == '*****@*****.**'
コード例 #4
0
ファイル: test_remote_sync.py プロジェクト: caitp/inbox
def test_merge_conflict(config):
    """Test that merge() raises an error on conflict."""
    base = Contact(name='Original Name',
                   email_address='*****@*****.**')
    remote = Contact(name='New Name',
                     email_address='*****@*****.**')
    dest = Contact(name='Some Other Name',
                   email_address='*****@*****.**')
    with pytest.raises(MergeError):
        merge(base, remote, dest)

    # Check no update in case of conflict
    assert dest.name == 'Some Other Name'
    assert dest.email_address == '*****@*****.**'