From 3b03a819a8d0b0ef219994eedb0b9ff2ce0d085f Mon Sep 17 00:00:00 2001 From: Daniel <d.hornung@indiscale.com> Date: Thu, 11 May 2023 18:02:45 +0200 Subject: [PATCH] WIP: Rename caosdb -> linkahead --- .../{.caosdbignore => .linkaheadignore} | 0 .../{caosdbignore-example => linkaheadignore-example} | 0 unittests/test_json_schema_model_parser.py | 6 +++--- .../{test_caosdbignore.py => test_linkaheadignore.py} | 9 ++++++--- unittests/test_sss_helper.py | 6 +++--- unittests/test_utils.py | 2 +- unittests/test_yaml_model_parser.py | 8 ++++---- 7 files changed, 17 insertions(+), 14 deletions(-) rename unittests/data/Publications/Posters/2019-02-03_something/{.caosdbignore => .linkaheadignore} (100%) rename unittests/{caosdbignore-example => linkaheadignore-example} (100%) rename unittests/{test_caosdbignore.py => test_linkaheadignore.py} (85%) diff --git a/unittests/data/Publications/Posters/2019-02-03_something/.caosdbignore b/unittests/data/Publications/Posters/2019-02-03_something/.linkaheadignore similarity index 100% rename from unittests/data/Publications/Posters/2019-02-03_something/.caosdbignore rename to unittests/data/Publications/Posters/2019-02-03_something/.linkaheadignore diff --git a/unittests/caosdbignore-example b/unittests/linkaheadignore-example similarity index 100% rename from unittests/caosdbignore-example rename to unittests/linkaheadignore-example diff --git a/unittests/test_json_schema_model_parser.py b/unittests/test_json_schema_model_parser.py index b93f61c0..ea52701d 100644 --- a/unittests/test_json_schema_model_parser.py +++ b/unittests/test_json_schema_model_parser.py @@ -184,7 +184,7 @@ def test_enum(): assert model[name].has_parent(model["number_enum"], retrieve=False) -@pytest.mark.xfail(reason="Don't allow integer enums until https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/224 has been fixed") +@pytest.mark.xfail(reason="Don't allow integer enums until https://gitlab.indiscale.com/caosdb/src/linkahead-server/-/issues/224 has been fixed") def test_int_enum(): """Check an enum property with type: integer""" # @author Florian Spreckelsen @@ -354,5 +354,5 @@ def test_name_property(): broken = parse_model_from_json_schema(os.path.join( FILEPATH, "datamodel_name_wrong_type.schema.json")) assert str(err.value).startswith( - "The 'name' property must be string-typed, otherwise it cannot be identified with CaosDB's " - "name property.") + "The 'name' property must be string-typed, otherwise it cannot be identified with " + "LinkAhead's name property.") diff --git a/unittests/test_caosdbignore.py b/unittests/test_linkaheadignore.py similarity index 85% rename from unittests/test_caosdbignore.py rename to unittests/test_linkaheadignore.py index d017b308..e4d9e3f7 100644 --- a/unittests/test_caosdbignore.py +++ b/unittests/test_linkaheadignore.py @@ -29,17 +29,20 @@ import re from tempfile import NamedTemporaryFile import unittest -from linkaheadadvancedtools.loadFiles import compile_file_list, create_re_for_file_list, combine_ignore_files +from linkaheadadvancedtools.loadFiles import (compile_file_list, + create_re_for_file_list, + combine_ignore_files, + ) BASEDIR = os.path.dirname(os.path.realpath(__file__)) -class Caosdbignore(unittest.TestCase): +class LinkAheadIgnore(unittest.TestCase): def setUp(self): pass def test_compile(self): - files = compile_file_list(os.path.join(BASEDIR, "caosdbignore-example"), + files = compile_file_list(os.path.join(BASEDIR, "linkaheadignore-example"), os.path.join(BASEDIR, "data")) assert len(files) == 3 assert os.path.join(BASEDIR, "data", "datatypes.xlsx") in files diff --git a/unittests/test_sss_helper.py b/unittests/test_sss_helper.py index 5c0143fc..4cd8e382 100644 --- a/unittests/test_sss_helper.py +++ b/unittests/test_sss_helper.py @@ -8,7 +8,7 @@ from linkaheadadvancedtools.serverside.helper import (NameCollector, get_data, get_file_via_download, init_data_model, parse_arguments, send_mail) -from caosdb import RecordType, configure_connection, get_config +from linkahead import RecordType, configure_connection, get_config from linkahead.connection.mockup import MockUpResponse, MockUpServerConnection from pytest import mark, raises @@ -110,8 +110,8 @@ def test_get_file_via_download(): # TODO test whether something ends up in the logger class NotThere(DummyFile): def download(*args, **kwargs): - raise db.CaosDBException() - with raises(db.CaosDBException): + raise db.LinkAheadException() + with raises(db.LinkAheadException): get_file_via_download(Inconsistent()) diff --git a/unittests/test_utils.py b/unittests/test_utils.py index f958a957..80010413 100644 --- a/unittests/test_utils.py +++ b/unittests/test_utils.py @@ -27,7 +27,7 @@ from tempfile import NamedTemporaryFile import linkahead as db from linkaheadadvancedtools.utils import (check_win_path, get_referenced_files, string_to_person, create_entity_link) -from caosdb import RecordType, configure_connection, get_config +from linkahead import RecordType, configure_connection, get_config from linkahead.connection.mockup import MockUpResponse, MockUpServerConnection from linkahead.exceptions import TransactionError diff --git a/unittests/test_yaml_model_parser.py b/unittests/test_yaml_model_parser.py index b5dc6a3b..b75114bf 100644 --- a/unittests/test_yaml_model_parser.py +++ b/unittests/test_yaml_model_parser.py @@ -220,7 +220,7 @@ RT2: self.assertTrue(isinstance(model['c'], db.Property)) self.assertEqual(model['c'].datatype, db.LIST(db.TEXT)) - # This failed for an older version of caosdb-models + # This failed for an older version of linkahead-models string_list = """ A: obligatory_properties: @@ -405,7 +405,7 @@ b: def test_issue_72(): """Tests for - https://gitlab.indiscale.com/caosdb/src/caosdb-advanced-user-tools/-/issues/72 + https://gitlab.indiscale.com/caosdb/src/linkahead-advanced-user-tools/-/issues/72 In some cases, faulty values would be read in for properties without a specified value. @@ -465,7 +465,7 @@ TestExperiment: def test_file_role(): """Not implemented for now, see - https://gitlab.indiscale.com/caosdb/src/caosdb-advanced-user-tools/-/issues/74. + https://gitlab.indiscale.com/caosdb/src/linkahead-advanced-user-tools/-/issues/74. """ model = """ @@ -479,7 +479,7 @@ F: def test_issue_36(): """Test whether the `parent` keyword is deprecated. - See https://gitlab.com/caosdb/caosdb-advanced-user-tools/-/issues/36. + See https://gitlab.com/linkahead/linkahead-advanced-user-tools/-/issues/36. """ model_string = """ -- GitLab