Skip to content
Snippets Groups Projects
Commit c99d9bc4 authored by florian's avatar florian
Browse files

WIP: Update file tests

parent 87f99bed
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ from caosdb import Info
from caosdb import administration as admin
from caosdb import execute_query, get_config, get_connection
from caosdb.common import models
from caosdb.exceptions import EntityError
from caosdb.exceptions import EntityError, TransactionError
from caosdb.utils.checkFileSystemConsistency import runCheck
......@@ -241,9 +241,10 @@ def test_file6():
path="testfiles2/",
pickup=path)
with raises(EntityError) as cm:
with raises(TransactionError) as te:
folder_.insert()
errors = cm.value.entity.get_errors()
cm = te.value.get_errors()[0]
errors = cm.entity.get_errors()
assert errors[0].description == 'This target path does already exist.'
finally:
try:
......@@ -300,7 +301,9 @@ def test_file7():
path="testfiles2/",
pickup="path")
assert_raises(EntityError, folder_.insert)
with raises(TransactionError) as te:
folder_.insert()
assert te.value.has_error(EntityError)
finally:
try:
folder_.delete()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment