Esempio n. 1
0
	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)
Esempio n. 2
0
    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)
Esempio n. 3
0
	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)
Esempio n. 4
0
    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)