diff --git a/tests/test_datatype_inheritance.py b/tests/test_datatype_inheritance.py index 4ab7311ac56baebadd24fb05e967c29fd769c281..cac389f606e209eca2f031aa409ecd3ca01b20ef 100644 --- a/tests/test_datatype_inheritance.py +++ b/tests/test_datatype_inheritance.py @@ -27,7 +27,7 @@ import caosdb as db from caosdb.connection.connection import get_connection from caosdb.exceptions import TransactionError -from pytest import raises +from pytest import mark, raises def setup_function(function): @@ -154,6 +154,7 @@ def test_datatype_overriding_update(): assert str("DATETIME").lower() == rt.get_properties()[0].datatype.lower() +@mark.xfail(reason="https://gitlab.com/linkahead/linkahead-server/-/issues/257") def test_recordtype_to_record(): rt = RecordType(name="SimpleTextRecordType") rt.datatype = "TEXT" @@ -169,9 +170,9 @@ def test_recordtype_to_record(): rec = Record().add_parent(name="SimpleTextRecordType").insert() assert rec.is_valid() - # TODO - # assert rec.datatype is not None - # assert str("TEXT").lower() == rec.datatype.lower() + # This fails to inherit the datatype + assert rec.datatype is not None + assert str("TEXT").lower() == rec.datatype.lower() def test_concrete_property(): diff --git a/tests/test_issues_server.py b/tests/test_issues_server.py index 7f76085d1b675968f0aed29678fe9b89caaf0e7e..7a2b470a5a9e2b1fdd1c5284a91566f4192a513c 100644 --- a/tests/test_issues_server.py +++ b/tests/test_issues_server.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # This file is a part of the CaosDB Project. # -# Copyright (c) 2020 - 2022 IndiScale GmbH <info@indiscale.com> +# Copyright (c) 2020 - 2024 IndiScale GmbH <info@indiscale.com> # Copyright (c) 2022 Daniel Hornung <d.hornung@indiscale.com> # Copyright (c) 2020 Florian Spreckelsen <f.spreckelsen@indiscale.com> -# Copyright (c) 2021 - 2022 Timm Fitschen <t.fitschen@indiscale.com> +# Copyright (c) 2021 - 2024 Timm Fitschen <t.fitschen@indiscale.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -19,18 +19,18 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -"""Tests for issues on gitlab.com, project caosdb-server.""" +"""Tests for issues on gitlab.com, project linkahead-server.""" import math import os import tempfile import time -import caosdb as db +import linkahead as db import pytest -from caosdb import administration as admin -from caosdb.exceptions import (TransactionError, HTTPClientError, HTTPURITooLongError) +from linkahead import administration as admin +from linkahead.exceptions import (TransactionError, HTTPClientError, HTTPURITooLongError) CURATOR_ROLE = "curator" @@ -1453,3 +1453,26 @@ def test_235_long_name(): except Exception as exc: assert not isinstance(exc, db.HTTPServerError) # TODO more specific error should be asserted + + +@pytest.mark.xfail(reason="https://gitlab.com/linkahead/linkahead-server/-/issues/248") +def test_248(): + """Querying for entities with property fails if using ID.""" + rt = db.RecordType(name="RT1").insert() + prop = db.Property(name="prop", datatype=db.DOUBLE).insert() + rec = db.Record().add_parent(rt).add_property(prop, value=23).insert() + results = db.execute_query(f"FIND Entity with {prop.id}") + assert len(results) == 1 + + +@pytest.mark.xfail(reason="https://gitlab.com/linkahead/linkahead-server/-/issues/253") +def test_253(): + """Value in string queries may not start with large number of digits.""" + test_strings = [ + "0123456789", + "hello" + "0123456789" * 5 + "world", + "0123456789" * 5 + "world", + ] + for string in test_strings: + results = db.execute_query(f"FIND Entity with prop={string}") + assert len(results) == 0