From 8b0973aef0d962b891fbfff46b9ecff74158b604 Mon Sep 17 00:00:00 2001 From: Daniel <daniel@harvey> Date: Mon, 27 Apr 2020 14:12:09 +0200 Subject: [PATCH] TEST: Removed xfail from test for caosdb-mysqlbackend #18 --- tests/test_issues_mysqlbackend.py | 9 ++++----- tests/test_update.py | 9 ++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/test_issues_mysqlbackend.py b/tests/test_issues_mysqlbackend.py index 98665a0..c276f6a 100644 --- a/tests/test_issues_mysqlbackend.py +++ b/tests/test_issues_mysqlbackend.py @@ -48,10 +48,9 @@ def teardown(): # ########################### Issue tests start here ########################### -@pytest.mark.xfail @with_setup(setup, teardown) def test_issue_18(): - """Sometimes, duplicate parents were returned. + """Duplicate parents were returned in some cases of self-hineritance. Tests for https://gitlab.com/caosdb/caosdb-mysqlbackend/-/issues/18 """ @@ -64,9 +63,9 @@ def test_issue_18(): C.add_parent(C) # The self-parenting is here on purpose C.add_parent(A) - c = db.Container() - c.extend([B, C, A]) - c.insert() + cont = db.Container() + cont.extend([B, C, A]) + cont.insert() C1 = db.Entity(name="C").retrieve() pids = [p.id for p in C1.parents] diff --git a/tests/test_update.py b/tests/test_update.py index a97d821..f783ff1 100644 --- a/tests/test_update.py +++ b/tests/test_update.py @@ -49,7 +49,8 @@ def test_property_no_id(): rt1 = db.RecordType(name="RT1").insert() rt1.add_property(name="P1").update(raise_exception_on_error=False) - assert rt1.get_property("P1").get_errors()[0].description == "Entity has no ID." + assert rt1.get_property("P1").get_errors()[0].description \ + == "Entity has no ID." def test_parent_no_id(): @@ -57,7 +58,8 @@ def test_parent_no_id(): parent = db.RecordType(name="RTP").insert() child.add_parent(name="RTP").update(raise_exception_on_error=False) - assert child.get_parent("RTP").get_errors()[0].description == "Entity has no ID." + assert child.get_parent("RTP").get_errors()[0].description \ + == "Entity has no ID." def test_update_1(): @@ -104,7 +106,8 @@ def test_server_error_during_update(): p = db.Property(name="TestProperty", datatype="TestRT1").insert() p2 = db.Property(name="TestBogusProperty", datatype=db.TEXT).insert() rec1 = db.Record(name="TestRT1Rec1").add_parent("TestRT1").insert() - rec2 = db.Record(name="TestRT2Rec2").add_parent("TestRT2").add_property("TestProperty", "TestRT1Rec1").insert() + rec2 = db.Record(name="TestRT2Rec2").add_parent("TestRT2").add_property( + "TestProperty", "TestRT1Rec1").insert() # do stupid things rec2.get_property("TestProperty").add_property("TestBogusProperty") -- GitLab