tests: Add missing copyright headers
[babeltrace.git] / tests / bindings / python / bt2 / test_message_iterator.py
index 0ad56329da087136891185765fa6f18d5b83f8df..64f34d04c00cb51f7a75803e04b53d215d94690c 100644 (file)
@@ -1,3 +1,22 @@
+
+#
+# Copyright (C) 2019 EfficiOS Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; only version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+
 from bt2 import value
 import collections
 import unittest
@@ -40,13 +59,14 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                        message_iterator_class=MyIter):
             def __init__(self, params):
                 nonlocal the_output_port_from_source
-                the_output_port_from_source = self._add_output_port('out')
+                the_output_port_from_source = self._add_output_port('out', 'user data')
 
         initialized = False
         graph = self._create_graph(MySource)
         graph.run()
         self.assertTrue(initialized)
         self.assertEqual(the_output_port_from_source.addr, the_output_port_from_iter.addr)
+        self.assertEqual(the_output_port_from_iter.user_data, 'user data')
 
     def test_finalize(self):
         class MyIter(bt2._UserMessageIterator):
@@ -166,6 +186,6 @@ class OutputPortMessageIteratorTestCase(unittest.TestCase):
                 self.assertIsInstance(msg, bt2.message._StreamEndMessage)
             else:
                 self.assertIsInstance(msg, bt2.message._EventMessage)
-                self.assertEqual(msg.event.event_class.name, 'salut')
+                self.assertEqual(msg.event.cls.name, 'salut')
                 field = msg.event.payload_field['my_int']
                 self.assertEqual(field, at * 3)
This page took 0.024625 seconds and 4 git commands to generate.