Skip to content
Snippets Groups Projects
Commit d83c3008 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

STY: autopep8'd

parent 009e2c07
No related branches found
No related tags found
2 merge requests!217TST: Make NamedTemporaryFiles Windows-compatible,!212ENH: introduce inheritance of identifiables
Pipeline #59891 passed with warnings
...@@ -51,6 +51,7 @@ def _retrieve_RecordType(id=None, name =None): ...@@ -51,6 +51,7 @@ def _retrieve_RecordType(id=None, name =None):
""" """
return db.RecordType(name=name, id=id).retrieve() return db.RecordType(name=name, id=id).retrieve()
def get_children_of_rt(rtname): def get_children_of_rt(rtname):
"""Supply the name of a recordtype. This name and the name of all children RTs are returned in """Supply the name of a recordtype. This name and the name of all children RTs are returned in
a list""" a list"""
...@@ -659,7 +660,6 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter): ...@@ -659,7 +660,6 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter):
else: else:
return None return None
def _get_registered_for_rt(self, rt: db.RecordType): def _get_registered_for_rt(self, rt: db.RecordType):
""" """
returns the registered identifiable for the given RecordType or the returns the registered identifiable for the given RecordType or the
...@@ -682,9 +682,6 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter): ...@@ -682,9 +682,6 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter):
else: else:
return None return None
def retrieve_identified_record_for_identifiable(self, identifiable: Identifiable): def retrieve_identified_record_for_identifiable(self, identifiable: Identifiable):
query_string = self.create_query_for_identifiable(identifiable) query_string = self.create_query_for_identifiable(identifiable)
try: try:
......
...@@ -371,6 +371,7 @@ def test_split_into_inserts_and_updates_with_circ(crawler_mocked_identifiable_re ...@@ -371,6 +371,7 @@ def test_split_into_inserts_and_updates_with_circ(crawler_mocked_identifiable_re
with pytest.raises(RuntimeError): with pytest.raises(RuntimeError):
crawler._split_into_inserts_and_updates(st) crawler._split_into_inserts_and_updates(st)
@patch("caoscrawler.identifiable_adapters._retrieve_RecordType", @patch("caoscrawler.identifiable_adapters._retrieve_RecordType",
new=Mock(side_effect=lambda id, name: db.RecordType(id=id, name=name))) new=Mock(side_effect=lambda id, name: db.RecordType(id=id, name=name)))
def test_split_into_inserts_and_updates_with_complex(crawler_mocked_identifiable_retrieve): def test_split_into_inserts_and_updates_with_complex(crawler_mocked_identifiable_retrieve):
...@@ -400,6 +401,7 @@ def test_split_into_inserts_and_updates_with_complex(crawler_mocked_identifiable ...@@ -400,6 +401,7 @@ def test_split_into_inserts_and_updates_with_complex(crawler_mocked_identifiable
# TODO write test where the unresoled entity is not part of the identifiable # TODO write test where the unresoled entity is not part of the identifiable
@patch("caoscrawler.identifiable_adapters._retrieve_RecordType", @patch("caoscrawler.identifiable_adapters._retrieve_RecordType",
new=Mock(side_effect=lambda id, name: db.RecordType(id=id, name=name))) new=Mock(side_effect=lambda id, name: db.RecordType(id=id, name=name)))
@patch("caoscrawler.crawl.cached_get_entity_by", @patch("caoscrawler.crawl.cached_get_entity_by",
...@@ -584,6 +586,7 @@ def test_split_into_inserts_and_updates_diff_backref(crawler_mocked_for_backref_ ...@@ -584,6 +586,7 @@ def test_split_into_inserts_and_updates_diff_backref(crawler_mocked_for_backref_
assert len(update) == 2 assert len(update) == 2
assert len(insert) == 1 assert len(insert) == 1
@patch("caoscrawler.identifiable_adapters._retrieve_RecordType", @patch("caoscrawler.identifiable_adapters._retrieve_RecordType",
new=Mock(side_effect=lambda id, name: db.RecordType(id=id, name=name))) new=Mock(side_effect=lambda id, name: db.RecordType(id=id, name=name)))
def test_replace_entities_with_ids(): def test_replace_entities_with_ids():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment