From c99d9bc494cff8ba6c1f9d2ad3c311d384efb7f0 Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Thu, 9 Jul 2020 15:52:42 +0200 Subject: [PATCH] WIP: Update file tests --- tests/test_file.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_file.py b/tests/test_file.py index 4dbf4fd..f842860 100644 --- a/tests/test_file.py +++ b/tests/test_file.py @@ -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() -- GitLab