Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D346A17966 for ; Thu, 10 Sep 2015 00:34:04 +0000 (UTC) Received: (qmail 29462 invoked by uid 500); 10 Sep 2015 00:34:04 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 29370 invoked by uid 500); 10 Sep 2015 00:34:04 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 28326 invoked by uid 99); 10 Sep 2015 00:34:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Sep 2015 00:34:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 16B7AE0991; Thu, 10 Sep 2015 00:34:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tonysun83@apache.org To: commits@couchdb.apache.org Date: Thu, 10 Sep 2015 00:34:27 -0000 Message-Id: <3d9194667f6c4fe19bcebe3a491598ba@git.apache.org> In-Reply-To: <04b44bd7fb69459eb9433cc2b3060647@git.apache.org> References: <04b44bd7fb69459eb9433cc2b3060647@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [25/26] couchdb-mango git commit: Reinstate skip tests Reinstate skip tests COUCHDB-2787 Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/17e4abff Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/17e4abff Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/17e4abff Branch: refs/heads/master Commit: 17e4abffaec605d14f836d6b05ec1423da612a31 Parents: f12076f Author: Tony Sun Authored: Tue Sep 8 11:13:49 2015 -0700 Committer: Tony Sun Committed: Tue Sep 8 11:13:49 2015 -0700 ---------------------------------------------------------------------- test/01-index-crud-test.py | 8 +++--- test/04-key-tests.py | 2 +- test/05-index-selection-test.py | 4 +-- test/06-basic-text-test.py | 38 ++++++++++++++--------------- test/06-text-default-field-test.py | 18 +++++++------- test/07-text-custom-field-list-test.py | 6 ++--- test/08-text-limit-test.py | 6 ++--- test/09-text-sort-test.py | 6 ++--- test/README.md | 3 ++- test/mango.py | 2 +- 10 files changed, 47 insertions(+), 46 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/17e4abff/test/01-index-crud-test.py ---------------------------------------------------------------------- diff --git a/test/01-index-crud-test.py b/test/01-index-crud-test.py index 2852a6a..021d66e 100644 --- a/test/01-index-crud-test.py +++ b/test/01-index-crud-test.py @@ -16,10 +16,10 @@ import mango import unittest class IndexCrudTests(mango.DbPerClass): - # @classmethod - # def setUpClass(klass): - # raise unittest.SkipTest('text index service not available') - # super(KeyTests, klass).setUpClass() + @classmethod + def setUpClass(klass): + raise unittest.SkipTest('text index service not available') + super(KeyTests, klass).setUpClass() def test_bad_fields(self): bad_fields = [ http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/17e4abff/test/04-key-tests.py ---------------------------------------------------------------------- diff --git a/test/04-key-tests.py b/test/04-key-tests.py index 9b55c7f..5174d0b 100644 --- a/test/04-key-tests.py +++ b/test/04-key-tests.py @@ -56,7 +56,7 @@ TEST_DOCS = [ class KeyTests(mango.DbPerClass): @classmethod def setUpClass(klass): - # raise unittest.SkipTest('text index service not available') + raise unittest.SkipTest('text index service not available') super(KeyTests, klass).setUpClass() klass.db.save_docs(TEST_DOCS, w=3) klass.db.create_index(["type"], ddoc="view") http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/17e4abff/test/05-index-selection-test.py ---------------------------------------------------------------------- diff --git a/test/05-index-selection-test.py b/test/05-index-selection-test.py index 375085f..4ded668 100644 --- a/test/05-index-selection-test.py +++ b/test/05-index-selection-test.py @@ -19,7 +19,7 @@ class IndexSelectionTests(mango.UserDocsTests): @classmethod def setUpClass(klass): super(IndexSelectionTests, klass).setUpClass() - user_docs.add_text_indexes(klass.db, {}) + # user_docs.add_text_indexes(klass.db, {}) def test_basic(self): resp = self.db.find({"name.last": "A last name"}, explain=True) @@ -77,7 +77,7 @@ class IndexSelectionTests(mango.UserDocsTests): class MultiTextIndexSelectionTests(mango.UserDocsTests): @classmethod def setUpClass(klass): - # raise unittest.SkipTest('text index service is not available') + raise unittest.SkipTest('text index service is not available') super(MultiTextIndexSelectionTests, klass).setUpClass() klass.db.create_text_index(ddoc="foo", analyzer="keyword") klass.db.create_text_index(ddoc="bar", analyzer="email") http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/17e4abff/test/06-basic-text-test.py ---------------------------------------------------------------------- diff --git a/test/06-basic-text-test.py b/test/06-basic-text-test.py index 593e6d7..72a3918 100644 --- a/test/06-basic-text-test.py +++ b/test/06-basic-text-test.py @@ -17,24 +17,24 @@ import user_docs import num_string_docs -# class TextIndexCheckTests(mango.DbPerClass): +class TextIndexCheckTests(mango.DbPerClass): -# def test_create_text_index(self): -# body = json.dumps({ -# 'index': { -# 'fields': 'test' -# }, -# 'type': 'text' -# }) -# resp = self.db.sess.post(self.db.path("_index"), data=body) -# assert resp.status_code == 503, resp + def test_create_text_index(self): + body = json.dumps({ + 'index': { + 'fields': 'test' + }, + 'type': 'text' + }) + resp = self.db.sess.post(self.db.path("_index"), data=body) + assert resp.status_code == 503, resp class BasicTextTests(mango.UserDocsTextTests): - # @classmethod - # def setUpClass(klass): - # raise unittest.SkipTest('text index service not available') + @classmethod + def setUpClass(klass): + raise unittest.SkipTest('text index service not available') def test_simple(self): docs = self.db.find({"$text": "Stephanie"}) @@ -431,9 +431,9 @@ class BasicTextTests(mango.UserDocsTextTests): class ElemMatchTests(mango.FriendDocsTextTests): - # @classmethod - # def setUpClass(klass): - # raise unittest.SkipTest('text index service not available') + @classmethod + def setUpClass(klass): + raise unittest.SkipTest('text index service not available') def test_elem_match_non_object(self): q = {"bestfriends":{ @@ -566,9 +566,9 @@ class ElemMatchTests(mango.FriendDocsTextTests): # Test numeric strings for $text class NumStringTests(mango.NumStringDocsTextTests): - # @classmethod - # def setUpClass(klass): - # raise unittest.SkipTest('text index service not available') + @classmethod + def setUpClass(klass): + raise unittest.SkipTest('text index service not available') def test_floating_point_val(self): float_point_string = num_string_docs.DOCS[2]["number_string"] http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/17e4abff/test/06-text-default-field-test.py ---------------------------------------------------------------------- diff --git a/test/06-text-default-field-test.py b/test/06-text-default-field-test.py index 599cad6..f4aaf9a 100644 --- a/test/06-text-default-field-test.py +++ b/test/06-text-default-field-test.py @@ -18,9 +18,9 @@ class NoDefaultFieldTest(mango.UserDocsTextTests): DEFAULT_FIELD = False - # @classmethod - # def setUpClass(klass): - # raise unittest.SkipTest('text index service not available') + @classmethod + def setUpClass(klass): + raise unittest.SkipTest('text index service not available') def test_basic(self): docs = self.db.find({"$text": "Ramona"}) @@ -40,9 +40,9 @@ class NoDefaultFieldWithAnalyzer(mango.UserDocsTextTests): "analyzer": "keyword" } - # @classmethod - # def setUpClass(klass): - # raise unittest.SkipTest('text not supported') + @classmethod + def setUpClass(klass): + raise unittest.SkipTest('text not supported') def test_basic(self): docs = self.db.find({"$text": "Ramona"}) @@ -61,9 +61,9 @@ class DefaultFieldWithCustomAnalyzer(mango.UserDocsTextTests): "analyzer": "keyword" } - # @classmethod - # def setUpClass(klass): - # raise unittest.SkipTest('text not supported') + @classmethod + def setUpClass(klass): + raise unittest.SkipTest('text not supported') def test_basic(self): docs = self.db.find({"$text": "Ramona"}) http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/17e4abff/test/07-text-custom-field-list-test.py ---------------------------------------------------------------------- diff --git a/test/07-text-custom-field-list-test.py b/test/07-text-custom-field-list-test.py index c59c3a2..8d68a1f 100644 --- a/test/07-text-custom-field-list-test.py +++ b/test/07-text-custom-field-list-test.py @@ -16,9 +16,9 @@ import unittest class CustomFieldsTest(mango.UserDocsTextTests): - # @classmethod - # def setUpClass(klass): - # raise unittest.SkipTest('text index service not available') + @classmethod + def setUpClass(klass): + raise unittest.SkipTest('text index service not available') FIELDS = [ {"name": "favorites.[]", "type": "string"}, http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/17e4abff/test/08-text-limit-test.py ---------------------------------------------------------------------- diff --git a/test/08-text-limit-test.py b/test/08-text-limit-test.py index 31083ae..36bf4a9 100644 --- a/test/08-text-limit-test.py +++ b/test/08-text-limit-test.py @@ -16,9 +16,9 @@ import unittest class LimitTests(mango.LimitDocsTextTests): - # @classmethod - # def setUpClass(klass): - # raise unittest.SkipTest('text index service not available') + @classmethod + def setUpClass(klass): + raise unittest.SkipTest('text index service not available') def test_limit_field(self): q = {"$or": [{"user_id" : {"$lt" : 10}}, {"filtered_array.[]": 1}]} http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/17e4abff/test/09-text-sort-test.py ---------------------------------------------------------------------- diff --git a/test/09-text-sort-test.py b/test/09-text-sort-test.py index c06c680..7bdf54a 100644 --- a/test/09-text-sort-test.py +++ b/test/09-text-sort-test.py @@ -15,9 +15,9 @@ import unittest class SortTests(mango.UserDocsTextTests): - # @classmethod - # def setUpClass(klass): - # raise unittest.SkipTest('text index service is not available') + @classmethod + def setUpClass(klass): + raise unittest.SkipTest('text index service is not available') def test_number_sort(self): q = {"age": {"$gt": 0}} http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/17e4abff/test/README.md ---------------------------------------------------------------------- diff --git a/test/README.md b/test/README.md index 810fc0a..17abf23 100644 --- a/test/README.md +++ b/test/README.md @@ -1,10 +1,11 @@ Mango Tests =========== +CouchDB should be started with ./dev/run -a testuser:testpass. + To run these, do this in the top level directory: $ virtualenv venv $ source venv/bin/activate $ pip install nose requests $ nosetests - http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/17e4abff/test/mango.py ---------------------------------------------------------------------- diff --git a/test/mango.py b/test/mango.py index 3464b14..fa7d52c 100644 --- a/test/mango.py +++ b/test/mango.py @@ -33,7 +33,7 @@ class Database(object): self.port = port self.dbname = dbname self.sess = requests.session() - self.sess.auth = ('adm', 'pass') + self.sess.auth = ('testuser', 'testpass') self.sess.headers["Content-Type"] = "application/json" @property