Skip to content
Snippets Groups Projects
Verified Commit cf109d5b authored by Alexander Kreft's avatar Alexander Kreft
Browse files

TST: move unittest to integrationtest

parent 08e13a67
No related branches found
No related tags found
2 merge requests!22Release 0.3,!17f move test
Pipeline #13986 passed
......@@ -33,13 +33,6 @@ class DataModelTest(unittest.TestCase):
rt = db.execute_query("FIND RECORDTYPE TestRecord", unique=True)
assert rt.get_property("test") is not None
def tearDown(self):
try:
tests = db.execute_query("FIND test*")
tests.delete()
except Exception:
pass
def test_missing(self):
# Test sync with missing prop
# insert propt
......@@ -52,3 +45,19 @@ class DataModelTest(unittest.TestCase):
dm.sync_data_model(noquestion=True)
rt = db.execute_query("FIND RECORDTYPE TestRecord", unique=True)
assert rt.get_property("testproperty") is not None
def test_get_existing_entities(self):
db.RecordType(name="TestRecord").insert()
c = db.Container().extend([
db.Property(name="test"),
db.RecordType(name="TestRecord")])
exist = DataModel.get_existing_entities(c)
assert len(exist) == 1
assert exist[0].name == "TestRecord"
def tearDown(self):
try:
tests = db.execute_query("FIND test*")
tests.delete()
except Exception:
pass
import unittest
import caosdb as db
import pytest
from caosadvancedtools.models.data_model import DataModel
class DataModelTest(unittest.TestCase):
def tearDown(self):
try:
tests = db.execute_query("FIND test*")
tests.delete()
except Exception:
pass
def test_collecting(self):
maintained = {"one": db.RecordType(name="TestRecord").add_property(
name="testproperty"),
......@@ -24,17 +16,6 @@ class DataModelTest(unittest.TestCase):
assert "TestRecord" in names
assert "testproperty" in names
# TODO this seems to require integration test
@pytest.mark.xfail(reason="This test will need an integration test. See issue #51")
def test_get_existing_entities(self):
db.RecordType(name="TestRecord").insert()
c = db.Container().extend([
db.Property(name="testproperty"),
db.RecordType(name="TestRecord")])
exist = DataModel.get_existing_entities(c)
assert len(exist) == 1
assert exist[0].name == "TestRecord"
def test_sync_ids_by_name(self):
container = db.Container().extend([db.RecordType(name="TestRecord"),
db.RecordType(name="TestRecord2"),
......
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