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

Merge branch 'f-remove-noscript-from-xml' into 'dev'

parents d7181bda bd830295
Branches
Tags
1 merge request!82Add test for https://gitlab.com/linkahead/linkahead-pylib/-/issues/89
Pipeline #58005 passed
......@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added (for new features)
* Test for [caosdb-pylib#89](https://gitlab.com/linkahead/linkahead-pylib/-/issues/89)
* Tests for entity state [caosdb-server!62](https://gitlab.com/caosdb/caosdb-server/-/merge_requests/62)
* Tests for version history
* Tests for inheritance bug (caosdb/caosdb-server!54)
......
......@@ -28,8 +28,10 @@ import math
import os
import tempfile
import time
import warnings
import linkahead as db
import linkahead.common.utils
import pytest
from linkahead import administration as admin
......@@ -66,6 +68,30 @@ def teardown_function(function):
# ########################### Issue tests start here #####################
def test_gitlab_com_89():
"""
Test that after retrieving an entity from the server, generating an xml
string and subsequently recreating the container from xml does not
generate any errors.
See https://gitlab.com/linkahead/linkahead-pylib/-/issues/89 and
https://gitlab.indiscale.com/caosdb/customers/f-fit/management/-/issues/81
"""
# We need a container generated with data from the server
rt = db.RecordType(name="TestType")
rt.insert()
container = db.execute_query("FIND RECORDTYPE *")
# With this container, to_xml, xml2str, and from_xml should not generate
# warnings - the simplefilter means that any warning fails the test
with warnings.catch_warnings():
warnings.simplefilter("error")
xml_str = linkahead.common.utils.xml2str(container.to_xml())
cont_from_xml = db.Container.from_xml(xml_str)
assert len(cont_from_xml) == len(container)
assert cont_from_xml[0].name == rt.name
# @pytest.mark.xfail(reason="Entities with many, long, properties: "
# "https://gitlab.com/linkahead/linkahead-pylib/-/issues/108")
def test_gitlab_com_108():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment