Ejemplo n.º 1
0
    def testMetadata(self):
        info = DocumentInfo("meta")
        info.rev_sequence = 23
        info.rev_meta = "fancy metadata here"
        info.content_type = DocumentInfo.INVALID_JSON
        self.store[info] = "the regular non-meta data"

        gotInfo = self.store.get_doc_info_by_id("meta")
        self.assertEquals(gotInfo.id, "meta")
        self.assertEquals(gotInfo.rev_sequence, info.rev_sequence)
        self.assertEquals(gotInfo.rev_meta, info.rev_meta)
        self.assertEquals(gotInfo.content_type, info.content_type)
        self.assertFalse(gotInfo.compressed)
Ejemplo n.º 2
0
    def testMetadata(self):
        info = DocumentInfo("meta")
        info.rev_sequence = 23
        info.rev_meta = "fancy metadata here"
        info.content_type = DocumentInfo.INVALID_JSON
        self.store[info] = "the regular non-meta data"

        gotInfo = self.store.get_doc_info_by_id("meta")
        self.assertEquals(gotInfo.id, "meta")
        self.assertEquals(gotInfo.rev_sequence, info.rev_sequence)
        self.assertEquals(gotInfo.rev_meta, info.rev_meta)
        self.assertEquals(gotInfo.content_type, info.content_type)
        self.assertFalse(gotInfo.compressed)
Ejemplo n.º 3
0
    def testMetadataSave(self):
        info = DocumentInfo("meta")
        info.rev_sequence = 23
        info.rev_meta = "fancy metadata here"
        info.content_type = DocumentInfo.INVALID_JSON
        self.store[info] = "the regular non-meta data"

        self.store.commit()
        self.store.close()
        self.store = CouchStore("/tmp/test.couch", 'r')

        gotInfo = self.store.get_doc_info_by_id("meta")
        self.assertEquals(gotInfo.id, "meta")
        self.assertEquals(gotInfo.rev_sequence, info.rev_sequence)
        self.assertEquals(gotInfo.rev_meta, info.rev_meta)
        self.assertEquals(gotInfo.content_type, info.content_type)
        self.assertFalse(gotInfo.compressed)
Ejemplo n.º 4
0
    def testMetadataSave(self):
        info = DocumentInfo("meta")
        info.rev_sequence = 23
        info.rev_meta = "fancy metadata here"
        info.content_type = DocumentInfo.INVALID_JSON
        self.store[info] = "the regular non-meta data"

        self.store.commit()
        self.store.close()
        self.store = CouchStore("/tmp/test.couch", 'r')

        gotInfo = self.store.get_doc_info_by_id("meta")
        self.assertEquals(gotInfo.id, "meta")
        self.assertEquals(gotInfo.rev_sequence, info.rev_sequence)
        self.assertEquals(gotInfo.rev_meta, info.rev_meta)
        self.assertEquals(gotInfo.content_type, info.content_type)
        self.assertFalse(gotInfo.compressed)