Closed GoogleCodeExporter closed 8 years ago
Actually, this would be even nicer. Add API to get to the config:
diff --git a/couchdb/client.py b/couchdb/client.py
--- a/couchdb/client.py
+++ b/couchdb/client.py
@@ -177,6 +177,17 @@
:type: `unicode`
""")
+ def _get_config(self):
+ resp, data = self.resource.get('/_config')
+ return data
+ config = property(_get_config, doc="""\
+ The configuration data for the CouchDB server.
+
+ Requests an object with basic configuration data from the server.
+
+ :type: `dict`
+ """)
+
def create(self, name):
"""Create a new database with the given name.
diff --git a/couchdb/tests/client.py b/couchdb/tests/client.py
--- a/couchdb/tests/client.py
+++ b/couchdb/tests/client.py
@@ -27,6 +27,10 @@
if 'python-tests' in self.server:
del self.server['python-tests']
+ def test_server_vars(self):
+ version = self.server.version
+ config = self.server.config
+
def test_create_large_doc(self):
self.db['foo'] = {'data': '0123456789' * 110 * 1024} # 10 MB
self.assertEqual('foo', self.db['foo']['_id'])
Then the above patch becomes even smaller:
diff --git a/couchdb/tests/client.py b/couchdb/tests/client.py
--- a/couchdb/tests/client.py
+++ b/couchdb/tests/client.py
@@ -159,6 +159,9 @@
self.assertEqual(i, res[idx].key)
def test_view_function_objects(self):
+ if 'python' not in self.server.config['query_servers']:
+ return
+
for i in range(1, 4):
self.db.create({'i': i, 'j':2*i})
Original comment by djc.ochtman
on 19 Mar 2009 at 2:47
Applied in r142. Thanks and sorry for the long wait!
Original comment by cmlenz
on 15 Apr 2009 at 4:23
Original issue reported on code.google.com by
djc.ochtman
on 19 Mar 2009 at 1:39