lib: bt_graph_create(): accept MIP version
[babeltrace.git] / tests / bindings / python / bt2 / test_graph.py
index 49c08512505c8210e2446ff338ee91cbb91edeb6..b719d9ca133e7b6956e7bbdb72a0bfc257f4ae01 100644 (file)
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
 
-from bt2 import value
-import collections
 import unittest
-import copy
 import bt2
 
 
@@ -54,8 +51,19 @@ class GraphTestCase(unittest.TestCase):
     def tearDown(self):
         del self._graph
 
-    def test_create_empty(self):
-        graph = bt2.Graph()
+    def test_create_default(self):
+        bt2.Graph()
+
+    def test_create_known_mip_version(self):
+        bt2.Graph(0)
+
+    def test_create_invalid_mip_version_type(self):
+        with self.assertRaises(TypeError):
+            bt2.Graph('')
+
+    def test_create_unknown_mip_version(self):
+        with self.assertRaisesRegex(ValueError, 'unknown MIP version'):
+            bt2.Graph(1)
 
     def test_add_component_user_cls(self):
         class MySink(bt2._UserSinkComponent):
This page took 0.02294 seconds and 4 git commands to generate.