def test_create_keep_handle(self): c = Connector() with c.create("public.data", "test.foo", [self.store1]) as w: w.commit() doc = w.getDoc() rev = w.getRev() # perform a GC cycle self.gc(self.store1) l = c.lookup_doc(doc) self.assertEqual(l.revs(), [rev]) self.assertEqual(l.preRevs(), []) c.stat(rev)
def test_collect(self): c = Connector() # deliberately close handle after creating! with c.create("public.data", "test.foo", [self.store1]) as w: w.commit() doc = w.getDoc() rev = w.getRev() # perform a GC cycle self.gc(self.store1) l = c.lookup_doc(doc) self.assertEqual(l.revs(), []) self.assertEqual(l.preRevs(), []) self.assertRaises(IOError, c.stat, rev)