diff --git a/README.md b/README.md index b3c2e3bf..fa90e5c1 100644 --- a/README.md +++ b/README.md @@ -83,12 +83,12 @@ Integration tests are run against a LimeSurvey instance, and both PostgreSQL and MySQL backends, using Docker Compose. The following versions of LimeSurvey were tested for this release: +- [6.4.1](https://github.com/LimeSurvey/LimeSurvey/releases/tag/6.4.1+240108) - [6.4.0](https://github.com/LimeSurvey/LimeSurvey/releases/tag/6.4.0+231218) - [6.3.9](https://github.com/LimeSurvey/LimeSurvey/releases/tag/6.3.9+231211) -- [6.3.8](https://github.com/LimeSurvey/LimeSurvey/releases/tag/6.3.8+231204) +- [5.6.50](https://github.com/LimeSurvey/LimeSurvey/releases/tag/5.6.50+240109) - [5.6.49](https://github.com/LimeSurvey/LimeSurvey/releases/tag/5.6.49+231212) - [5.6.48](https://github.com/LimeSurvey/LimeSurvey/releases/tag/5.6.48+231205) -- [5.6.47](https://github.com/LimeSurvey/LimeSurvey/releases/tag/5.6.47+231128) ## Installation diff --git a/src/citric/client.py b/src/citric/client.py index 8e7ec79b..1195faa6 100644 --- a/src/citric/client.py +++ b/src/citric/client.py @@ -1098,6 +1098,18 @@ def get_server_version(self) -> str: """ return self._get_site_setting("versionnumber") + def get_db_version(self) -> int: + """Get the LimeSurvey database version. + + Calls :rpc_method:`get_site_settings("dbversionnumber") `. + + Returns: + The LimeSurvey database version. + + .. versionadded:: NEXT_VERSION + """ + return self._get_site_setting("dbversionnumber") + def get_summary(self, survey_id: int) -> dict[str, int]: """Get survey summary. diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 17a3f8de..95b3e9d5 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -52,4 +52,4 @@ def server_version(client: citric.Client) -> semver.Version: @pytest.fixture(scope="session") def database_version(client: citric.Client) -> int: """Get the LimeSurvey database schema version.""" - return client._get_site_setting("dbversionnumber") + return client.get_db_version() diff --git a/tests/test_client.py b/tests/test_client.py index 0ee87e09..6725f17c 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -43,6 +43,8 @@ class MockSession(Session): "sitename": "mock-site", "defaultlang": "mock-lang", "restrictToLanguages": "en fr es", + "versionnumber": "6.0.0", + "dbversionnumber": 321, } def rpc(self, method: str, *params: t.Any) -> dict[str, t.Any]: @@ -427,6 +429,16 @@ def test_get_available_languages(client: MockClient): assert client.get_available_languages() == ["en", "fr", "es"] +def test_get_server_version(client: MockClient): + """Test get server version.""" + assert client.get_server_version() == "6.0.0" + + +def test_get_database_version(client: MockClient): + """Test get database version.""" + assert client.get_db_version() == 321 + + def test_import_group(client: MockClient, tmp_path: Path): """Test import_group client method.""" random_bytes = randbytes(100)