Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
    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)
Пример #4
0
    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)