Permalink
Browse files

fix size propery of DocumentInfo representation

Change-Id: I05ca5b105835b454593f1e3fbec682306e1bfaa2
Reviewed-on: http://review.couchbase.org/34142
Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
Tested-by: Aaron Miller <apage43@ninjawhale.com>
Tested-by: buildbot <build@couchbase.com>
  • Loading branch information...
1 parent 2ba0189 commit 069ab01c5e757e6b982f99dfd58a85054bca8b4a @pavel-paulau pavel-paulau committed with pavel-paulau Mar 4, 2014
Showing with 13 additions and 2 deletions.
  1. +2 −2 python/couchstore.py
  2. +11 −0 python/couchstore_test.py
View
@@ -162,10 +162,10 @@ def _asStruct(self):
return struct
def __str__(self):
- return "DocumentInfo('%s', %d bytes)" % (self.id, self.size)
+ return "DocumentInfo('%s', %d bytes)" % (self.id, self.physSize)
def __repr__(self):
- return "DocumentInfo('%s', %d bytes)" % (self.id, self.size)
+ return "DocumentInfo('%s', %d bytes)" % (self.id, self.physSize)
def dump(self):
return "DocumentInfo('%s', %d bytes, seq=%d, revSeq=%d, deleted=%s, " \
View
@@ -173,6 +173,17 @@ def checkDoc(docInfo):
self.store.forEachDoc(None, None, checkDoc)
self.assertEqual(docCount[0], 50)
+ def testDocumentInfoRepr(self):
+ self.addDocs(1)
+
+ def checkDoc(docInfo):
+ expected = "DocumentInfo('%s', %d bytes)" % (docInfo.id,
+ docInfo.physSize)
+ self.assertEquals(str(docInfo), expected)
+ self.assertEquals(repr(docInfo), expected)
+
+ self.store.forEachDoc(None, None, checkDoc)
+
def testForSomeDocs(self):
self.addDocs(50)
docCount = [0]

0 comments on commit 069ab01

Please sign in to comment.