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

add tests

parent 68fa4970
No related branches found
No related tags found
No related merge requests found
......@@ -244,6 +244,8 @@ class CaosDBPythonEntity(object):
return (val, False)
elif pr[0:4] == "LIST":
return self._type_converted_list(val, pr)
elif isinstance(val, Entity):
return (convert_to_python_object(val), False)
else:
return (int(val), True)
......
......@@ -84,3 +84,8 @@ def test_get_property_with_entity():
p = Property(id=1234)
r.add_property(id=1234, value="bla")
assert r.get_property(p).value == "bla"
def test_selected_reference_list():
assert len(testrecord.get_property("Conductor").value) == 1
assert isinstance(testrecord.get_property("Conductor").value[0], Entity)
......@@ -328,4 +328,10 @@
<Value>45531</Value>
<Value>45532</Value>
</Property>
<Property datatype="LIST&lt;Person&gt;" description="DESCRIBE ME!" id="1634561234" importance="FIX" name="Conductor">
<Value>
<Record id="23456543">
</Record>
</Value>
</Property>
</Record>
......@@ -24,7 +24,6 @@
"""Tests for caosdb.common.utils."""
from __future__ import unicode_literals
from lxml.etree import Element
from nose.tools import assert_equals as eq
from caosdb.common.utils import xml2str
......@@ -32,4 +31,4 @@ def test_xml2str():
name = 'Björn'
element = Element(name)
serialized = xml2str(element)
eq(serialized, "<Björn/>\n")
assert serialized == "<Björn/>\n"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment