diff --git a/unittests/test_apiutils.py b/unittests/test_apiutils.py index 2859a0ec529d5b1a5f51b57b1407320ba98f8d73..1df392a3f66dff3e2c760359bd61eb7f4ed32823 100644 --- a/unittests/test_apiutils.py +++ b/unittests/test_apiutils.py @@ -26,6 +26,7 @@ # A. Schlemmer, 02/2018 +import pytest import caosdb as db import caosdb.apiutils from caosdb.apiutils import (apply_to_ids, compare_entities, create_id_query, diff --git a/unittests/test_entity.py b/unittests/test_entity.py index 1e88702ac016d7dcfdf00919dd0f93b5d3345e00..f2891fda266e1d62139b4cb2667c31b090ca6498 100644 --- a/unittests/test_entity.py +++ b/unittests/test_entity.py @@ -26,10 +26,13 @@ import unittest from lxml import etree +import os from caosdb import (INTEGER, Entity, Property, Record, RecordType, configure_connection) from caosdb.connection.mockup import MockUpServerConnection +UNITTESTDIR = os.path.dirname(os.path.abspath(__file__)) + class TestEntity(unittest.TestCase): @@ -87,7 +90,7 @@ class TestEntity(unittest.TestCase): """ parser = etree.XMLParser(remove_comments=True) entity = Entity._from_xml(Entity(), - etree.parse("unittests/test_record.xml", + etree.parse(os.path.join(UNITTESTDIR, "test_record.xml"), parser).getroot()) self.assertEqual(entity.role, "Record")