test_value.py: make `BoolValueTestCase` inherit `_TestNumericValue`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 29 Jun 2019 16:04:41 +0000 (12:04 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 3 Jul 2019 01:31:27 +0000 (21:31 -0400)
`BoolValue` is a numeric value, so `BoolValueTestCase` can inherit
`_TestNumericValue` and get more tests.

_inject_numeric_testing_methods() is also called on `BoolValueTestCase`
to test the different unary and binary operators.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I8fff73a0dda1e9ec9f6737739dde255c9b079ebf
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1586
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
tests/bindings/python/bt2/test_value.py

index b1b191bc260c205b5a7ede00dfab66454d257678..75c89de95d96e1b46d284434ed86ffe153032fef 100644 (file)
@@ -713,7 +713,7 @@ class CreateValueFuncTestCase(unittest.TestCase):
             v = bt2.create_value(a)
 
 
-class BoolValueTestCase(_TestCopySimple, unittest.TestCase):
+class BoolValueTestCase(_TestNumericValue, unittest.TestCase):
     def setUp(self):
         self._f = bt2.BoolValue(False)
         self._t = bt2.BoolValue(True)
@@ -805,6 +805,9 @@ class BoolValueTestCase(_TestCopySimple, unittest.TestCase):
         self.assertNotEqual(self._t, False)
 
 
+_inject_numeric_testing_methods(BoolValueTestCase)
+
+
 class _TestIntegerValue(_TestNumericValue):
     def setUp(self):
         self._pv = 23
This page took 0.02755 seconds and 4 git commands to generate.