bt2: add `StringValue.__contains__()` method
[babeltrace.git] / tests / bindings / python / bt2 / test_value.py
index d5051f90d25c48fb762f977755843762fe2725e3..c73e397d9cd1433d20d050a607f48753c34d0cfc 100644 (file)
@@ -1535,6 +1535,15 @@ class StringValueTestCase(_TestCopySimple, unittest.TestCase):
         s1 = bt2.StringValue('allo')
         self.assertGreaterEqual('bateau', s1)
 
+    def test_in_string(self):
+        s1 = bt2.StringValue('beau grand bateau')
+        self.assertIn('bateau', s1)
+
+    def test_in_vstring(self):
+        s1 = bt2.StringValue('beau grand bateau')
+        s2 = bt2.StringValue('bateau')
+        self.assertIn(s2, s1)
+
     def test_bool_op(self):
         self.assertEqual(bool(self._def), bool(self._def_value))
 
This page took 0.023618 seconds and 4 git commands to generate.