python: factor out user_attributes getters and setters
To avoid repeating the `user_attributes()` methods everywhere, define
two mixin classes (_WithUserAttributesConst and _WithUserAttributes) and
use them throughout.
Note that this fixes a bug where _StreamClassConst.user_attributes would
return a (non-const) MapValue, since it used
bt2_value._create_from_ptr_and_get_ref, instead of
bt2_value._create_from_const_ptr_and_get_ref.
Improve tests to fill in some gaps we had in the testing of user
attributes. For all objects types that have user attributes, test
getting the user attributes from both the non-const and const versions
of the object, and verify that the return value of the
`user_attributes()` method is of the correct type.
Change-Id: I4a7542f015b5f3245395d64175761fe34aa1753f
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10243
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
15 files changed:
This page took 0.025404 seconds and 4 git commands to generate.