Skip to content
Snippets Groups Projects
Verified Commit 908593dc authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Merge branch 'f-filesystem-link' into f-filesystem-import

parents 6434fb2c 254e018a
No related branches found
No related tags found
1 merge request!53Draft: ENH: file system: import
Pipeline #49059 failed
......@@ -26,10 +26,10 @@
@author: tf
"""
from caosdb import administration as admin, Info, get_config
from caosdb.connection.connection import configure_connection, get_connection
from caosdb.exceptions import (HTTPClientError, HTTPForbiddenError,
LoginFailedError, HTTPResourceNotFoundError)
from linkahead import administration as admin, Info, get_config
from linkahead.connection.connection import configure_connection, get_connection
from linkahead.exceptions import (HTTPClientError, HTTPForbiddenError,
LoginFailedError, HTTPResourceNotFoundError)
from pytest import raises, mark
test_role = "test_role"
......
......@@ -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():
......
# -*- 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment