From 92413aeac485befe064bea5d89597ead747be2f0 Mon Sep 17 00:00:00 2001 From: "i.nueske" <i.nueske@indiscale.com> Date: Fri, 22 Nov 2024 11:53:09 +0100 Subject: [PATCH] TST: Added test for https://gitlab.com/linkahead/linkahead-pylib/-/issues/103 --- CHANGELOG.md | 1 + tests/test_issues_pylib.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aca13b7..3b854ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added (for new features) +* Test for [caosdb-pylib#103](https://gitlab.com/linkahead/linkahead-pylib/-/issues/103) * Tests for entity state [caosdb-server!62](https://gitlab.com/caosdb/caosdb-server/-/merge_requests/62) * Tests for version history * Tests for inheritance bug (caosdb/caosdb-server!54) diff --git a/tests/test_issues_pylib.py b/tests/test_issues_pylib.py index ec9e873..43a84e5 100644 --- a/tests/test_issues_pylib.py +++ b/tests/test_issues_pylib.py @@ -66,6 +66,25 @@ def teardown_function(function): # ########################### Issue tests start here ##################### +def test_gitlab_com_103(): + """ + Test that after causing an UriTooLong error the used auth_token + is still valid. + + See https://gitlab.com/linkahead/linkahead-pylib/-/issues/103 and + https://gitlab.indiscale.com/caosdb/customers/f-fit/management/-/issues/82 + """ + # + auth_token = db.get_connection()._authenticator.auth_token + db.configure_connection(auth_token=auth_token) + # + c = db.Container() + c.extend([db.Record(id=i) for i in range(1000,5000)]) + with pytest.raises(db.exceptions.TransactionError) as te: + c.retrieve() + assert "authentication token" not in str(te) + + # @pytest.mark.xfail(reason="Entities with many, long, properties: " # "https://gitlab.com/linkahead/linkahead-pylib/-/issues/108") def test_gitlab_com_108(): -- GitLab