tests: rename some fields in test_value.py
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 22 Nov 2023 17:24:50 +0000 (12:24 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Sat, 19 Oct 2024 11:12:09 +0000 (07:12 -0400)
The very short names used in _TestIntegerValue and descendants were very
mysterious to me, it took me a while to figure out what each meant.
Rename them to slightly longer names for clarity.

Change-Id: I28dce959516d5bc91deadddb56e420e6b65d0277
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11410
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
tests/bindings/python/bt2/test_value.py

index 0cf01734335d1cd0fee90c7a0dae378ab7643acf..4cf72b63ce7fdf68d573d95059344f614c676cdf 100644 (file)
@@ -1197,14 +1197,14 @@ _inject_numeric_testing_methods(BoolValueTestCase)
 
 class _TestIntegerValue(_TestNumericValue):
     def setUp(self):
-        self._pv = 23
-        self._ip = self._CLS(self._pv)
-        self._def = self._ip
-        self._def_value = self._pv
+        self._pos_raw_val = 23
+        self._pos_val = self._CLS(self._pos_raw_val)
+        self._def = self._pos_val
+        self._def_value = self._pos_raw_val
         self._def_new_value = 101
 
     def tearDown(self):
-        del self._ip
+        del self._pos_val
         del self._def
         del self._def_value
 
@@ -1226,11 +1226,11 @@ class _TestIntegerValue(_TestNumericValue):
         self.assertEqual(i, 0)
 
     def test_create_pos(self):
-        self.assertEqual(self._ip, self._pv)
+        self.assertEqual(self._pos_val, self._pos_raw_val)
 
     def test_create_from_vint(self):
-        i = self._CLS(self._ip)
-        self.assertEqual(i, self._pv)
+        i = self._CLS(self._pos_val)
+        self.assertEqual(i, self._pos_raw_val)
 
     def test_create_from_false(self):
         i = self._CLS(False)
@@ -1277,16 +1277,16 @@ class SignedIntegerValueTestCase(_TestIntegerValue, unittest.TestCase):
 
     def setUp(self):
         super().setUp()
-        self._nv = -52
-        self._in = self._CLS(self._nv)
+        self._neg_raw_val = -52
+        self._neg_val = self._CLS(self._neg_raw_val)
         self._def_new_value = -101
 
     def tearDown(self):
         super().tearDown()
-        del self._in
+        del self._neg_val
 
     def test_create_neg(self):
-        self.assertEqual(self._in, self._nv)
+        self.assertEqual(self._neg_val, self._neg_raw_val)
 
     def test_create_pos_too_big(self):
         with self._assert_expecting_int64():
@@ -1329,17 +1329,17 @@ _inject_numeric_testing_methods(UnsignedIntegerValueTestCase)
 
 class RealValueTestCase(_TestNumericValue, unittest.TestCase):
     def setUp(self):
-        self._pv = 23.4
-        self._nv = -52.7
-        self._fp = bt2.RealValue(self._pv)
-        self._fn = bt2.RealValue(self._nv)
-        self._def = self._fp
-        self._def_value = self._pv
+        self._pos_raw_val = 23.4
+        self._neg_raw_val = -52.7
+        self._pos_val = bt2.RealValue(self._pos_raw_val)
+        self._neg_val = bt2.RealValue(self._neg_raw_val)
+        self._def = self._pos_val
+        self._def_value = self._pos_raw_val
         self._def_new_value = -101.88
 
     def tearDown(self):
-        del self._fp
-        del self._fn
+        del self._pos_val
+        del self._neg_val
         del self._def
         del self._def_value
 
@@ -1355,10 +1355,10 @@ class RealValueTestCase(_TestNumericValue, unittest.TestCase):
         self.assertEqual(f, 0.0)
 
     def test_create_pos(self):
-        self.assertEqual(self._fp, self._pv)
+        self.assertEqual(self._pos_val, self._pos_raw_val)
 
     def test_create_neg(self):
-        self.assertEqual(self._fn, self._nv)
+        self.assertEqual(self._neg_val, self._neg_raw_val)
 
     def test_create_from_false(self):
         f = bt2.RealValue(False)
This page took 0.027584 seconds and 4 git commands to generate.