1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/python
Rob van der Linde 3a579eab8b netcmd: domain: model field tests
Add tests for model fields to ensure they behave as expected when
calling from_db_value and to_db_value methods.

Add a base class for the tests themselves via a mixin as unittest
doesn't support abstract test case classes.

For each field, from_db_value and to_db_value must either be a list or
a property that returns a list.

The list contains input values and expected values, the expected value
can also be a callback for more complex comparison, this is used for
the possible claim values xml.

It is important that singular values and list values are tested, and
also None to ensure that fields properly get unset when a model is
saved.

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-06-25 23:29:32 +00:00
..
examples python: Remove redundant assignments 2022-05-10 05:19:34 +00:00
samba netcmd: domain: model field tests 2023-06-25 23:29:32 +00:00
modules.c py3: Remove PyStr_FromString() compatability macro 2019-06-24 17:24:27 +00:00
modules.h python: Create macro to hide ugly function signature cast 2019-05-16 17:55:16 +00:00
py3compat.h py3compat: remove obsolete comments 2021-03-17 17:10:32 +00:00
pyglue.c pyglue: Raise an exception on error 2023-05-24 00:50:31 +00:00
wscript python/wscript: Remove unused format() argument 2022-05-10 05:19:34 +00:00