diff --git a/tests/test_issues_server.py b/tests/test_issues_server.py index 391004de7084ff77d1d7b924e04fdaf9506e768f..9120b9783db99bd4bd0fccfbefaf9c66f1bc6fb9 100644 --- a/tests/test_issues_server.py +++ b/tests/test_issues_server.py @@ -30,7 +30,7 @@ import caosdb as db import pytest from caosdb import administration as admin -from caosdb.exceptions import (TransactionError, HTTPClientError) +from caosdb.exceptions import (TransactionError, HTTPClientError, HTTPURITooLongError) CURATOR_ROLE = "curator" @@ -1405,6 +1405,22 @@ See https://gitlab.com/caosdb/caosdb-server/-/issues/220""" assert query.cached is False, "Query after name change of parent should not be cached." +@pytest.mark.xfail(reason="Needs fix for intermediate length strings, " + "see https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/101.") +def test_indiscale_101(): + """Unexpected server errors in case of intermediate length strings, + https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/101 + + """ + # This is ok + very_long_string = "Long string"*10000 + with pytest.raises(HTTPURITooLongError): + db.execute_query(f"FIND RECORD WITH test=\"{very_long_string}\"") + # This is not + long_string = "Long string"*100 + assert len(db.execute_query(f"FIND RECORD WITH test=\"{long_string}\"")) == 0 + + @pytest.mark.xfail(reason="Needs fix for keeping datatype, " "see https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/106") def test_indiscale_106():