fix: test_trimmer on macOs and Solaris
[babeltrace.git] / tests / bindings / python / bt2 / test_event.py
index 04978dfa99c292f6bba509b919a5269968c49ac8..a2727130a82c36ad7f83b41f52febd9cb4e1fce9 100644 (file)
@@ -1,3 +1,21 @@
+#
+# 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 collections import OrderedDict
 import unittest
 import bt2
@@ -11,7 +29,7 @@ class EventTestCase(unittest.TestCase):
                                    with_ep=False):
 
         class MyIter(bt2._UserMessageIterator):
-            def __init__(self):
+            def __init__(self, self_output_port):
                 self._at = 0
 
             def __next__(self):
@@ -110,7 +128,7 @@ class EventTestCase(unittest.TestCase):
 
     def test_attr_event_class(self):
         msg = self._create_test_event_message()
-        self.assertEqual(msg.event.event_class.addr, self.event_class.addr)
+        self.assertEqual(msg.event.cls.addr, self.event_class.addr)
 
     def test_attr_name(self):
         msg = self._create_test_event_message()
@@ -170,7 +188,8 @@ class EventTestCase(unittest.TestCase):
 
     def test_no_clock_value(self):
         msg = self._create_test_event_message(with_clockclass=False)
-        self.assertIsNone(msg.default_clock_snapshot)
+        with self.assertRaises(bt2.NonexistentClockSnapshot):
+            msg.default_clock_snapshot
 
     def test_stream(self):
         msg = self._create_test_event_message()
This page took 0.02519 seconds and 4 git commands to generate.