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

STY: autopep8'ed

parent 7d69ec63
No related branches found
No related tags found
No related merge requests found
......@@ -686,6 +686,7 @@ def apply_to_ids(entities, func):
for entity in entities:
_apply_to_ids_of_entity(entity, func)
def _apply_to_ids_of_entity(entity, func):
entity.id = func(entity.id)
......
......@@ -48,7 +48,7 @@ def test_pickle_object():
def test_apply_to_ids():
parent = db.RecordType(id=3456)
rec = db.Record(id=23)
p = db.Property(id=23345, datatype = db.INTEGER)
p = db.Property(id=23345, datatype=db.INTEGER)
rec.add_parent(parent)
rec.add_property(p)
......
......@@ -32,14 +32,12 @@ from caosdb.connection.mockup import MockUpServerConnection
class TestEntity(unittest.TestCase):
def setUp(self):
self.assertIsNotNone(Entity)
configure_connection(url="unittests", username="testuser",
password="testpassword", timeout=200,
implementation=MockUpServerConnection)
def test_instance_variables(self):
entity = Entity()
self.assertTrue(hasattr(entity, "role"))
......@@ -49,13 +47,11 @@ class TestEntity(unittest.TestCase):
self.assertTrue(hasattr(entity, "parents"))
self.assertTrue(hasattr(entity, "properties"))
def test_role(self):
entity = Entity(role="TestRole")
self.assertEqual(entity.role, "TestRole")
entity.role = "TestRole2"
self.assertEqual(entity.role, "TestRole2")
def test_instanciation(self):
self.assertRaises(Exception, Entity())
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