Skip to content
Snippets Groups Projects
Commit e1078ff7 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

TST: fixed apiutils tests

parent 52023318
No related branches found
No related tags found
2 merge requests!57RELEASE 0.7.3,!52F refactor high level api
......@@ -25,29 +25,12 @@
# Test apiutils
# A. Schlemmer, 02/2018
import pickle
import tempfile
import caosdb as db
import caosdb.apiutils
from caosdb.apiutils import (apply_to_ids, compare_entities, create_id_query,
resolve_reference)
from .test_property import testrecord
def test_convert_object():
r2 = db.apiutils.convert_to_python_object(testrecord)
assert r2.species == "Rabbit"
def test_pickle_object():
r2 = db.apiutils.convert_to_python_object(testrecord)
with tempfile.TemporaryFile() as f:
pickle.dump(r2, f)
f.seek(0)
rn2 = pickle.load(f)
assert r2.date == rn2.date
def test_apply_to_ids():
......@@ -230,3 +213,4 @@ def test_compare_special_properties():
assert diff_r2[key] == 2
assert len(diff_r1["properties"]) == 0
assert len(diff_r2["properties"]) == 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment