Move to kernel style SPDX license identifiers
[babeltrace.git] / tests / bindings / python / bt2 / test_connection.py
index 539f7bcb2fa3cbaea387da988c9a355cf12b3e60..e2f7f0108927caa05658a682dd833f4a22bdc069 100644 (file)
@@ -1,20 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-only
 #
 # 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.
-#
 
 import unittest
 import bt2
@@ -24,11 +11,9 @@ from bt2 import port as bt2_port
 
 class ConnectionTestCase(unittest.TestCase):
     def test_create(self):
-        class MyIter(bt2._UserMessageIterator):
-            def __next__(self):
-                raise bt2.Stop
-
-        class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
+        class MySource(
+            bt2._UserSourceComponent, message_iterator_class=bt2._UserMessageIterator
+        ):
             def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
@@ -46,11 +31,9 @@ class ConnectionTestCase(unittest.TestCase):
         self.assertIs(type(conn), bt2_connection._ConnectionConst)
 
     def test_downstream_port(self):
-        class MyIter(bt2._UserMessageIterator):
-            def __next__(self):
-                raise bt2.Stop
-
-        class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
+        class MySource(
+            bt2._UserSourceComponent, message_iterator_class=bt2._UserMessageIterator
+        ):
             def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
@@ -70,11 +53,9 @@ class ConnectionTestCase(unittest.TestCase):
         self.assertIs(type(conn.downstream_port), bt2_port._InputPortConst)
 
     def test_upstream_port(self):
-        class MyIter(bt2._UserMessageIterator):
-            def __next__(self):
-                raise bt2.Stop
-
-        class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
+        class MySource(
+            bt2._UserSourceComponent, message_iterator_class=bt2._UserMessageIterator
+        ):
             def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
This page took 0.024178 seconds and 4 git commands to generate.