test_{field,value}.py: array test cases: add non-sequence equality tests
[babeltrace.git] / tests / bindings / python / bt2 / test_value.py
index ca4957161cc65946d6a7c399cfc73be340a32acd..3521eb05b4fd37c02479734d750a7ee24fb491f7 100644 (file)
@@ -18,6 +18,7 @@
 
 from functools import partial, partialmethod
 import operator
+import collections
 import unittest
 import numbers
 import math
@@ -1287,6 +1288,12 @@ class ArrayValueTestCase(_TestCopySimple, unittest.TestCase):
         a2 = bt2.ArrayValue(copy.deepcopy(raw))
         self.assertEqual(a1, a2)
 
+    def test_eq_non_sequence_iterable(self):
+        dct = collections.OrderedDict([(1, 2), (3, 4), (5, 6)])
+        a = bt2.ArrayValue((1, 3, 5))
+        self.assertEqual(a, list(dct.keys()))
+        self.assertNotEqual(a, dct)
+
     def test_setitem_int(self):
         raw = 19
         self._def[2] = raw
This page took 0.023963 seconds and 4 git commands to generate.