Skip to content
Snippets Groups Projects
Verified Commit f2e77cc3 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

TEST: Test for linkahead-pylib#108

parent 29cdcc51
No related branches found
No related tags found
No related merge requests found
Pipeline #42727 failed
# -*- coding: utf-8 -*-
# This file is a part of the LinkAhead Project.
#
# Copyright (c) 2023 IndiScale GmbH <info@indiscale.com>
# Copyright (c) 2023 Daniel Hornung <d.hornung@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
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# 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 linkahead-pylib.
Tests should be named:
``test_gitlab_com_{issue_id}``
"""
import math
import os
import tempfile
import time
import linkahead as db
import pytest
from linkahead import administration as admin
from linkahead.exceptions import (TransactionError, HTTPClientError)
CURATOR_ROLE = "curator"
def setup_module():
db.configure_connection()
try:
db.execute_query("FIND ENTITY WITH ID > 99").delete()
except Exception as delete_exc:
print(delete_exc)
try:
admin._delete_user("TestUser")
except Exception as delete_exc:
print(delete_exc)
try:
admin._delete_role(CURATOR_ROLE)
except Exception as delete_exc:
print(delete_exc)
def setup_function(function):
"""No setup required."""
setup_module()
def teardown_function(function):
"""Deleting entities again."""
setup_module()
# ########################### Issue tests start here #####################
@pytest.mark.xfail(reason="Entities with many, long, properties: "
"https://gitlab.com/linkahead/linkahead-pylib/-/issues/108")
def test_gitlab_com_108(self):
# create RT and one property
cont = db.Container()
long = "Long" * 50
first_RT = db.RecordType(name=f"TestRecord_first")
for index in range(20):
this_RT = db.RecordType(name=f"TestRecord_{long}_{index:02d}")
first_RT.add_property(this_RT)
cont.append(first_RT)
cont.retrieve()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment