pytdb: Fix repr segfault for internal db
[anatoliy/anatoliy.git] / lib / tdb / python / tests / simple.py
index 5db824753b10f8b55a61eb4bb4d8b8ab0487b78f..258a486f91a5683beafaf0058558e1fcd2f386c3 100644 (file)
@@ -28,6 +28,14 @@ class CloseTdbTests(TestCase):
         self.tdb.close()
 
 
+class InternalTdbTests(TestCase):
+    def test_repr(self):
+        self.tdb = tdb.Tdb("whatever", tdb_flags=tdb.INTERNAL)
+
+        # repr used to crash on internal db
+        self.assertEquals(repr(self.tdb), "Tdb('<internal>')")
+
+
 class SimpleTdbTests(TestCase):
 
     def setUp(self):