From 7ee3b9844b5b6b2cfbc468f1025d1fb315ed3cf8 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 27 Nov 2023 15:17:43 -0500 Subject: [PATCH] tests: assign to `value` property in test_assign_str/test_assign_vstr These tests don't do what was initially intended. The intent is to assign a string to the value in `self._def`. Instead, they overwrite `self._def`. Fix that by assigning to the `value` property. Change-Id: Ic5d0e797d5da7cc0fb17daa0b5e221db5c440bf9 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/11446 Tested-by: jenkins Reviewed-by: Philippe Proulx --- tests/bindings/python/bt2/test_value.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/bindings/python/bt2/test_value.py b/tests/bindings/python/bt2/test_value.py index 4bd75a2e..0cf01734 100644 --- a/tests/bindings/python/bt2/test_value.py +++ b/tests/bindings/python/bt2/test_value.py @@ -1493,12 +1493,12 @@ class StringValueTestCase(_TestCopySimple, unittest.TestCase): def test_assign_str(self): raw = "zorg" - self._def = raw + self._def.value = raw self.assertEqual(self._def, raw) def test_assign_vstr(self): raw = "zorg" - self._def = bt2.create_value(raw) + self._def.value = bt2.create_value(raw) self.assertEqual(self._def, raw) def test_eq(self): -- 2.34.1