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

STY: autopep8'ed

parent 7d69ec63
Branches
Tags
No related merge requests found
...@@ -686,6 +686,7 @@ def apply_to_ids(entities, func): ...@@ -686,6 +686,7 @@ def apply_to_ids(entities, func):
for entity in entities: for entity in entities:
_apply_to_ids_of_entity(entity, func) _apply_to_ids_of_entity(entity, func)
def _apply_to_ids_of_entity(entity, func): def _apply_to_ids_of_entity(entity, func):
entity.id = func(entity.id) entity.id = func(entity.id)
......
...@@ -48,7 +48,7 @@ def test_pickle_object(): ...@@ -48,7 +48,7 @@ def test_pickle_object():
def test_apply_to_ids(): def test_apply_to_ids():
parent = db.RecordType(id=3456) parent = db.RecordType(id=3456)
rec = db.Record(id=23) 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_parent(parent)
rec.add_property(p) rec.add_property(p)
......
...@@ -32,14 +32,12 @@ from caosdb.connection.mockup import MockUpServerConnection ...@@ -32,14 +32,12 @@ from caosdb.connection.mockup import MockUpServerConnection
class TestEntity(unittest.TestCase): class TestEntity(unittest.TestCase):
def setUp(self): def setUp(self):
self.assertIsNotNone(Entity) self.assertIsNotNone(Entity)
configure_connection(url="unittests", username="testuser", configure_connection(url="unittests", username="testuser",
password="testpassword", timeout=200, password="testpassword", timeout=200,
implementation=MockUpServerConnection) implementation=MockUpServerConnection)
def test_instance_variables(self): def test_instance_variables(self):
entity = Entity() entity = Entity()
self.assertTrue(hasattr(entity, "role")) self.assertTrue(hasattr(entity, "role"))
...@@ -49,13 +47,11 @@ class TestEntity(unittest.TestCase): ...@@ -49,13 +47,11 @@ class TestEntity(unittest.TestCase):
self.assertTrue(hasattr(entity, "parents")) self.assertTrue(hasattr(entity, "parents"))
self.assertTrue(hasattr(entity, "properties")) self.assertTrue(hasattr(entity, "properties"))
def test_role(self): def test_role(self):
entity = Entity(role="TestRole") entity = Entity(role="TestRole")
self.assertEqual(entity.role, "TestRole") self.assertEqual(entity.role, "TestRole")
entity.role = "TestRole2" entity.role = "TestRole2"
self.assertEqual(entity.role, "TestRole2") self.assertEqual(entity.role, "TestRole2")
def test_instanciation(self): def test_instanciation(self):
self.assertRaises(Exception, Entity()) self.assertRaises(Exception, Entity())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment