Remove `skip-string-normalization` in Python formatter config
[babeltrace.git] / tests / bindings / python / bt2 / test_component.py
index c215c44d36c29e0b86de1249bd39c7f9197c2333..71808fa52dbb77f901df94e2fcf40701f7638f23 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
@@ -27,19 +14,19 @@ class UserComponentTestCase(unittest.TestCase):
         graph = bt2.Graph()
 
         if name is None:
-            name = 'comp'
+            name = "comp"
 
         return graph.add_component(comp_cls, name, logging_level=log_level)
 
     def test_name(self):
         class MySink(bt2._UserSinkComponent):
             def __init__(comp_self, config, params, obj):
-                self.assertEqual(comp_self.name, 'yaes')
+                self.assertEqual(comp_self.name, "yaes")
 
             def _user_consume(self):
                 pass
 
-        self._create_comp(MySink, 'yaes')
+        self._create_comp(MySink, "yaes")
 
     def test_logging_level(self):
         class MySink(bt2._UserSinkComponent):
@@ -49,7 +36,7 @@ class UserComponentTestCase(unittest.TestCase):
             def _user_consume(self):
                 pass
 
-        self._create_comp(MySink, 'yaes', bt2.LoggingLevel.INFO)
+        self._create_comp(MySink, "yaes", bt2.LoggingLevel.INFO)
 
     def test_graph_mip_version(self):
         class MySink(bt2._UserSinkComponent):
@@ -59,7 +46,7 @@ class UserComponentTestCase(unittest.TestCase):
             def _user_consume(self):
                 pass
 
-        self._create_comp(MySink, 'yaes', bt2.LoggingLevel.INFO)
+        self._create_comp(MySink, "yaes", bt2.LoggingLevel.INFO)
 
     def test_class(self):
         class MySink(bt2._UserSinkComponent):
@@ -94,7 +81,7 @@ class UserComponentTestCase(unittest.TestCase):
                 finalized = True
 
         graph = bt2.Graph()
-        comp = graph.add_component(MySink, 'lel')
+        comp = graph.add_component(MySink, "lel")
 
         del graph
         del comp
@@ -144,7 +131,7 @@ class GenericComponentTestCase(unittest.TestCase):
         graph = bt2.Graph()
 
         if name is None:
-            name = 'comp'
+            name = "comp"
 
         return graph.add_component(comp_cls, name, logging_level=log_level)
 
@@ -153,15 +140,15 @@ class GenericComponentTestCase(unittest.TestCase):
             def _user_consume(self):
                 pass
 
-        comp = self._create_comp(MySink, 'yaes')
-        self.assertEqual(comp.name, 'yaes')
+        comp = self._create_comp(MySink, "yaes")
+        self.assertEqual(comp.name, "yaes")
 
     def test_logging_level(self):
         class MySink(bt2._UserSinkComponent):
             def _user_consume(self):
                 pass
 
-        comp = self._create_comp(MySink, 'yaes', bt2.LoggingLevel.WARNING)
+        comp = self._create_comp(MySink, "yaes", bt2.LoggingLevel.WARNING)
         self.assertEqual(comp.logging_level, bt2.LoggingLevel.WARNING)
 
     def test_class(self):
@@ -182,5 +169,5 @@ class GenericComponentTestCase(unittest.TestCase):
         self.assertNotEqual(comp.addr, 0)
 
 
-if __name__ == '__main__':
+if __name__ == "__main__":
     unittest.main()
This page took 0.02566 seconds and 4 git commands to generate.