X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fbindings%2Fpython%2Fbt2%2Ftest_trace.py;h=5a9275628cf7b0ac6018955aa146eea6448f9704;hb=5783664e46332216fd38a7b287258a7c9543af57;hp=85615b4b515ba7d001e15fc80661af24c848daa3;hpb=48be9a9176ef8d3a81390d43769093d91e9d5227;p=babeltrace.git diff --git a/tests/bindings/python/bt2/test_trace.py b/tests/bindings/python/bt2/test_trace.py index 85615b4b..5a927562 100644 --- a/tests/bindings/python/bt2/test_trace.py +++ b/tests/bindings/python/bt2/test_trace.py @@ -30,11 +30,24 @@ class TraceTestCase(unittest.TestCase): self.assertIsNone(trace.name) self.assertIsNone(trace.uuid) self.assertEqual(len(trace.env), 0) + self.assertEqual(len(trace.user_attributes), 0) def test_create_invalid_name(self): with self.assertRaises(TypeError): self._tc(name=17) + def test_create_user_attributes(self): + trace = self._tc(user_attributes={'salut': 23}) + self.assertEqual(trace.user_attributes, {'salut': 23}) + + def test_create_invalid_user_attributes(self): + with self.assertRaises(TypeError): + self._tc(user_attributes=object()) + + def test_create_invalid_user_attributes_value_type(self): + with self.assertRaises(TypeError): + self._tc(user_attributes=23) + def test_attr_trace_class(self): trace = self._tc() self.assertEqual(trace.cls.addr, self._tc.addr)