Skip to content
Snippets Groups Projects
Commit 3c7cb1cc authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

TST: Adapt unittest to removed parent keyword

parent 9f9aa7b8
No related branches found
No related tags found
2 merge requests!100WIP: Filling XLSX: Seems to be working.,!91F remove deprecated parent
......@@ -19,7 +19,7 @@
import unittest
from datetime import date
from tempfile import NamedTemporaryFile
from pytest import deprecated_call, raises, mark
from pytest import raises, mark
import linkahead as db
from caosadvancedtools.models.parser import (TwiceDefinedException,
......@@ -527,7 +527,7 @@ F:
def test_issue_36():
"""Test whether the `parent` keyword is deprecated.
"""Test whether the `parent` keyword is removed.
See https://gitlab.com/caosdb/caosdb-advanced-user-tools/-/issues/36.
......@@ -550,17 +550,12 @@ R3:
inherit_from_obligatory:
- R1
"""
with deprecated_call():
# Check whether this is actually deprecated
with raises(ValueError) as ve:
# The keyword has been removed, so it should raise a regular ValueError.
model = parse_model_from_string(model_string)
assert "R3" in model
r3 = model["R3"]
assert isinstance(r3, db.RecordType)
for par in ["R1", "R2"]:
# Until removal, both do the same
assert has_parent(r3, par)
assert r3.get_parent(par)._flags["inheritance"] == db.OBLIGATORY
assert "invalid keyword" in str(ve.value)
assert "parent" in str(ve.value)
def test_yaml_error():
......
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