diff --git a/unittests/test_sync_node.py b/unittests/test_sync_node.py index 171af8fc6441618beb8fdc80004a1b57ba482ac6..8526678992925dee8360a2f286fbead89d9513d0 100644 --- a/unittests/test_sync_node.py +++ b/unittests/test_sync_node.py @@ -171,30 +171,37 @@ def test_sync_node(): # merge with conflicting information # ---------------------------------- sn_a = SyncNode(db.Record(id=102)) - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="Trying to update"): sn_a.update(SyncNode(db.Record(id=101))) sn_a = SyncNode(db.Record(name='102')) - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="Trying to update"): sn_a.update(SyncNode(db.Record(name='101'))) sn_a = SyncNode(db.Record(name='102')) - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="Trying to update"): sn_a.update(SyncNode(db.File(name='102'))) sn_a = SyncNode(db.Record(description='102')) - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="Trying to update"): sn_a.update(SyncNode(db.Record(description='101'))) sn_a = SyncNode(db.File(path='102')) - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="Trying to update"): sn_a.update(SyncNode(db.File(path='101'))) sn_a = SyncNode(db.File(path='102')) sn_a.identifiable = Identifiable(name='a') - sn_b.identifiable = Identifiable(name='b') + # sn_b.identifiable = Identifiable(name='b') sn_b = SyncNode(db.File(path='101')) - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="Trying to update"): + sn_a.update(sn_b) + + sn_a = SyncNode(db.File(path='102')) + sn_a.identifiable = Identifiable(name='a') + sn_b = SyncNode(db.File(path='101')) + sn_b.identifiable = Identifiable(name='b') + with pytest.raises(ValueError, match="identifiable"): sn_a.update(sn_b)