Skip to content
Snippets Groups Projects
Commit b307817b authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

TST: added match strings to checks for errors

parent 72ce7aca
No related branches found
No related tags found
2 merge requests!178FIX: #96 Better error output for crawl.py script.,!167Sync Graph
Pipeline #51283 passed with warnings
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment