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

BUG: Fix typos, add xfails

parent 19095398
No related branches found
No related tags found
No related merge requests found
......@@ -33,8 +33,11 @@ from caosdb.exceptions import (AmbiguityException,
AuthorizationException, ContainerError,
EntityDoesNotExistError, EntityError,
EntityHasNoDatatypeError,
TransactionError, UniqueNamesError)
TransactionError, UniqueNamesError,
UnqualifiedParentsError,
UnqualifiedPropertiesError)
import pytest # TODO: remove when xfails have been dealt with
from pytest import raises
......@@ -47,7 +50,7 @@ def _add_error_message_to_entity(entity, code, description="Error message"):
description=description)
entity.add_message(message)
return enetity
return entity
def test_has_no_datatype_error():
......@@ -86,7 +89,7 @@ def test_entity_error():
ent = _add_error_message_to_entity(db.Entity(name="TestEnt"),
code)
with raises(TransactionError) as e:
raise_errors(e)
raise_errors(ent)
assert len(e.value.errors) == 1
err = e.value.errors[0]
assert isinstance(err, EntityError)
......@@ -145,7 +148,7 @@ def test_unqualified_parents_error():
assert isinstance(te.errors[0].errors[0], EntityDoesNotExistError)
assert te.errors[0].errors[0].entity.name == parent.name
@pytest.mark.xfail
def test_unqualified_properties_error():
"""Code 114; properties do not exist or have wrong data types or
values.
......@@ -175,7 +178,7 @@ def test_unqualified_properties_error():
# #################### Multiple errors ####################
@pytest.mark.xfail
def test_parent_and_properties_errors():
"""Record with UnqualifiedParentsError and UnqualifiedPropertiesError,
and corresponding parent and properties with their errors as
......@@ -202,7 +205,7 @@ def test_parent_and_properties_errors():
# TODO: Now there should be two direct children; both have to be
# displayed correctly.
@pytest.mark.xfail
def test_container_with_faulty_elements():
"""Code 12; container with valid and invalid entities. All faulty
entities have to be reflected correctly in the errors list of the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment