From b6f7d470116a7ddbb1bad25a8c1d10ac2c52c9bd Mon Sep 17 00:00:00 2001 From: Florian Spreckelsen <f.spreckelsen@inidscale.com> Date: Tue, 16 Jan 2024 17:02:13 +0100 Subject: [PATCH] TST: Add xfailing test for https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/101 --- tests/test_issues_server.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/test_issues_server.py b/tests/test_issues_server.py index 391004d..9120b97 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(): -- GitLab