diff --git a/src/caoscrawler/identifiable_adapters.py b/src/caoscrawler/identifiable_adapters.py index 3568978b12aabada85d1bad795d8194e17f1febc..f3296105107fe42a640870f68a1ffe3a63916009 100644 --- a/src/caoscrawler/identifiable_adapters.py +++ b/src/caoscrawler/identifiable_adapters.py @@ -60,11 +60,7 @@ def convert_value(value): # replace single quotes, otherwise they may break the queries return value.replace("\'", "\\'") else: - # TODO: check whether this here is needed: - # TODO: added strip, because whitespace is ignored by CaosDB anyways at the - # boundaries of the string - # return str(value).strip() - return f"{value}" + return str(value).strip() class IdentifiableAdapter(metaclass=ABCMeta): diff --git a/unittests/test_identifiable_adapters.py b/unittests/test_identifiable_adapters.py index 7f1ba9d752f1fa2cc1afacc7a5ec281451a79e2d..c9c9e86aee5dbebf12a83dcaa26eef2f9668bca5 100644 --- a/unittests/test_identifiable_adapters.py +++ b/unittests/test_identifiable_adapters.py @@ -50,9 +50,9 @@ def test_create_query_for_identifiable(): "h": db.Record(id=1111), "i": db.File(id=1112), "j": [2222, db.Record(id=3333)]})) - assert (query.lower() == "find record b with name='a' and 'c'='c' and 'd'='5' and 'e'='5.5'" - " and 'f'='2020-10-10t00:00:00' and 'g'='true' and 'h'='1111' and 'i'='1112' and " - "'j'='2222' and 'j'='3333' ") + assert (query == "FIND RECORD B WITH name='A' AND 'c'='c' AND 'd'='5' AND 'e'='5.5'" + " AND 'f'='2020-10-10T00:00:00' AND 'g'='TRUE' AND 'h'='1111' AND 'i'='1112' AND " + "'j'='2222' AND 'j'='3333' ") # The name can be the only identifiable query = IdentifiableAdapter.create_query_for_identifiable(