def testMetadata(self): info = DocumentInfo("meta") info.revSequence = 23 info.revMeta = "fancy metadata here" info.contentType = DocumentInfo.INVALID_JSON self.store[info] = "the regular non-meta data" gotInfo = self.store.getInfo("meta") self.assertEquals(gotInfo.id, "meta") self.assertEquals(gotInfo.revSequence, info.revSequence) self.assertEquals(gotInfo.revMeta, info.revMeta) self.assertEquals(gotInfo.contentType, info.contentType) self.assertFalse(gotInfo.compressed)
def testMetadataSave(self): info = DocumentInfo("meta") info.revSequence = 23 info.revMeta = "fancy metadata here" info.contentType = 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.getInfo("meta") self.assertEquals(gotInfo.id, "meta") self.assertEquals(gotInfo.revSequence, info.revSequence) self.assertEquals(gotInfo.revMeta, info.revMeta) self.assertEquals(gotInfo.contentType, info.contentType) self.assertFalse(gotInfo.compressed)