diff --git a/CHANGELOG.md b/CHANGELOG.md index ea8d8b58c6749df317f84b8cbe5e500a5fa62d6e..03f0808a1135b2d2e693dddaac08412f9c2bd5bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added (for new features) * Test for [caosdb-pylib#89](https://gitlab.com/linkahead/linkahead-pylib/-/issues/89) +* 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 49203bc2439e53616f5cd9c3867f54e5d2159d4e..94ffa891748a575bd810fb6ac00be4c09f3effd8 100644 --- a/tests/test_issues_pylib.py +++ b/tests/test_issues_pylib.py @@ -92,6 +92,26 @@ def test_gitlab_com_89(): assert cont_from_xml[0].name == rt.name +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 + """ + # Configure connection to use auth_token + auth_token = db.get_connection()._authenticator.auth_token + db.configure_connection(auth_token=auth_token) + + # Trigger UriTooLong error and check correct error thrown + 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():