Univention Bugzilla – Bug 53814
add udm_properties to ucsschool-rest-api client
Last modified: 2023-05-26 15:36:30 CEST
The ucsschool-rest-api client has to support the attribute udm_properties for schools and schoolclasses, which was added in kelvin version 1.5.0 Implemtation details: - move udm_properties to base class - adjust tests - adjust documentation - increase version to 1.5.0 to match kelvin version
The fix has been pushed to twenzel/kelvin-client/add_udm_properties
Link to the pull request https://github.com/univention/kelvin-rest-api-client/pull/127/files concerning new tests for udm_properties: If I want to test that like in the other tests, I would have to adjust the kelvin-api in the docker container. This would be an integration test including the a kelvin api configuration, which would have to be set + restart the container etc. ... or was something else meant by testing this? The user-tests did not test this neither (which is of course no reason not to do this)
As discussed, I added the tests for udm_properties. Unfortunately, it's relatively complicated to adjust the test-setup for only one test. So I create a mapped_properties files when the docker container(s) are created with the following content: { "user": ["title"], "school_class": ["mailAddress"], "school": ["description"] } Fortunately we have the hosts name -> fixture, so we don't run into problems when creating the mail address. I also changed the default of the factories, e.g. udm_properties = factory.Dict({"description": None}) This is not super-optimal, because it only reflects only our test scenario. The comparisions of ldap-values vs. kelvin-api values are made relatively automatic, so this seemed easier. On the other hand: this reflects our test scenario, because we do not expect any other values.
I merged the changes into master and did the 1.5.0 release on PyPI: https://pypi.org/project/kelvin-rest-api-client/ Documentation was updated here: https://kelvin-rest-api-client.readthedocs.io/en/latest/
Release was tested as well.
Released on https://pypi.org/project/kelvin-rest-api-client/