summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Avdey <eiri@eiri.ca>2018-01-04 15:21:05 -0400
committerGitHub <noreply@github.com>2018-01-04 15:21:05 -0400
commit4ac9ab077771f35c62bc7ba5bc8e717e0e2ba9b7 (patch)
tree5be8f959af353b2175c6080e8606c4e45cfff425
parentbc192d1e2849ce977de496601c763830a7449496 (diff)
parent0414ef3e5d39de159cb6e985110773ea5522aea4 (diff)
downloadcouchdb-4ac9ab077771f35c62bc7ba5bc8e717e0e2ba9b7.tar.gz
Merge pull request #1091 from apache/better-mango-test-recreate-function
Make sure mango tests's recreate fun creates db
-rw-r--r--src/mango/test/mango.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mango/test/mango.py b/src/mango/test/mango.py
index 560914b8c..ecf969e04 100644
--- a/src/mango/test/mango.py
+++ b/src/mango/test/mango.py
@@ -82,13 +82,15 @@ class Database(object):
def recreate(self):
r = self.sess.get(self.url)
- db_info = r.json()
- docs = db_info["doc_count"] + db_info["doc_del_count"]
- if docs == 0:
- # db never used - create unnecessary
- return
- self.delete()
+ if r.status_code == 200:
+ db_info = r.json()
+ docs = db_info["doc_count"] + db_info["doc_del_count"]
+ if docs == 0:
+ # db never used - create unnecessary
+ return
+ self.delete()
self.create()
+ self.recreate()
def save_doc(self, doc):
self.save_docs([doc])