You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by to...@apache.org on 2015/09/08 20:20:32 UTC
[1/2] couchdb-mango git commit: Reinstate skip tests
Repository: couchdb-mango
Updated Branches:
refs/heads/2787-merge-repos f12076f24 -> 1de64eabb
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/2787-merge-repos
Commit: 17e4abffaec605d14f836d6b05ec1423da612a31
Parents: f12076f
Author: Tony Sun <to...@cloudant.com>
Authored: Tue Sep 8 11:13:49 2015 -0700
Committer: Tony Sun <to...@cloudant.com>
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
[2/2] couchdb-mango git commit: Whitespace
Posted by to...@apache.org.
Whitespace
Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/1de64eab
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/1de64eab
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/1de64eab
Branch: refs/heads/2787-merge-repos
Commit: 1de64eabbf9af6a56562acdf3b71fa0c4c98fd0f
Parents: 17e4abf
Author: Tony Sun <to...@cloudant.com>
Authored: Tue Sep 8 11:22:03 2015 -0700
Committer: Tony Sun <to...@cloudant.com>
Committed: Tue Sep 8 11:22:03 2015 -0700
----------------------------------------------------------------------
src/mango_cursor_text.erl | 1 -
src/mango_error.erl | 2 +-
test/01-index-crud-test.py | 4 ++--
test/07-text-custom-field-list-test.py | 2 +-
test/literal_gen.py | 2 +-
5 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/1de64eab/src/mango_cursor_text.erl
----------------------------------------------------------------------
diff --git a/src/mango_cursor_text.erl b/src/mango_cursor_text.erl
index 971d153..847b04c 100644
--- a/src/mango_cursor_text.erl
+++ b/src/mango_cursor_text.erl
@@ -301,4 +301,3 @@ get_json_docs(DbName, Hits) ->
{Sort, not_found}
end
end, Hits).
-
http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/1de64eab/src/mango_error.erl
----------------------------------------------------------------------
diff --git a/src/mango_error.erl b/src/mango_error.erl
index 9b7ae82..f0a8ee2 100644
--- a/src/mango_error.erl
+++ b/src/mango_error.erl
@@ -58,7 +58,7 @@ info(mango_cursor_text, multiple_text_indexes) ->
<<"multiple_text_indexes">>,
<<"You must specify an index with the `use_index` parameter.">>
};
-info(mango_cursor_text, {text_search_error, {error, {bad_request, Msg}}})
+info(mango_cursor_text, {text_search_error, {error, {bad_request, Msg}}})
when is_binary(Msg) ->
{
400,
http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/1de64eab/test/01-index-crud-test.py
----------------------------------------------------------------------
diff --git a/test/01-index-crud-test.py b/test/01-index-crud-test.py
index 021d66e..24aa99d 100644
--- a/test/01-index-crud-test.py
+++ b/test/01-index-crud-test.py
@@ -227,7 +227,7 @@ class IndexCrudTests(mango.DbPerClass):
assert e.response.status_code == 404
else:
raise AssertionError("bad index delete")
-
+
@unittest.skip
def test_create_text_idx(self):
fields = [
@@ -246,7 +246,7 @@ class IndexCrudTests(mango.DbPerClass):
]
return
raise AssertionError("index not created")
-
+
@unittest.skip
def test_create_bad_text_idx(self):
bad_fields = [
http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/1de64eab/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 8d68a1f..f060d79 100644
--- a/test/07-text-custom-field-list-test.py
+++ b/test/07-text-custom-field-list-test.py
@@ -65,7 +65,7 @@ class CustomFieldsTest(mango.UserDocsTextTests):
docs = self.db.find({"location.state": "New Hampshire"})
assert len(docs) == 1
assert docs[0]["user_id"] == 10
-
+
# Since our FIELDS list only includes "name\\.first", we should
# get an error when we try to search for "name.first", since the index
# for that field does not exist.
http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/1de64eab/test/literal_gen.py
----------------------------------------------------------------------
diff --git a/test/literal_gen.py b/test/literal_gen.py
index 7cf60dd..cf46017 100644
--- a/test/literal_gen.py
+++ b/test/literal_gen.py
@@ -14,7 +14,7 @@ import random
from string import digits, hexdigits
def joiner(*items):
- return ''.join(item() for item in items)
+ return ''.join(item() for item in items)
def roll(item, n1, n2=None):
n2 = n2 or n1