Skip to content
Snippets Groups Projects
Commit 15b7ecf7 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

TST: allow tests to be called from src dir; import pytest

parent 6c1d336e
No related branches found
No related tags found
2 merge requests!57RELEASE 0.7.3,!52F refactor high level api
Pipeline #21941 passed with warnings
......@@ -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,
......
......@@ -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")
......
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