diff options
author | Eric Avdey <eiri@eiri.ca> | 2018-01-04 15:21:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-04 15:21:05 -0400 |
commit | 4ac9ab077771f35c62bc7ba5bc8e717e0e2ba9b7 (patch) | |
tree | 5be8f959af353b2175c6080e8606c4e45cfff425 | |
parent | bc192d1e2849ce977de496601c763830a7449496 (diff) | |
parent | 0414ef3e5d39de159cb6e985110773ea5522aea4 (diff) | |
download | couchdb-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.py | 14 |
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]) |