Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
push by matt.goo...@gmail.com - Fix load tool when authentication credentials are provided. on 2012-10-09 08:07 GMT
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
couchdb-pyt...@googlecode.com  
View profile  
 More options Oct 9 2012, 4:08 am
From: couchdb-pyt...@googlecode.com
Date: Tue, 09 Oct 2012 08:08:05 +0000
Local: Tues, Oct 9 2012 4:08 am
Subject: [couchdb-python] push by matt.goo...@gmail.com - Fix load tool when authentication credentials are provided. on 2012-10-09 08:07 GMT
Revision: 58b76bbcb082
Branch:   default
Author:   Alexander Shorin <kxe...@gmail.com>
Date:     Tue Oct  9 01:04:31 2012
Log:      Fix load tool when authentication credentials are provided.
http://code.google.com/p/couchdb-python/source/detail?r=58b76bbcb082

Added:
  /couchdb/tests/tools.py
Modified:
  /couchdb/tests/__init__.py
  /couchdb/tools/load.py

=======================================
--- /dev/null
+++ /couchdb/tests/tools.py     Tue Oct  9 01:04:31 2012
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2012 Alexander Shorin
+# All rights reserved.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution.
+#
+
+
+import unittest
+from StringIO import StringIO
+
+from couchdb.tools import load
+from couchdb.tests import testutil
+
+class ToolLoadTestCase(testutil.TempDatabaseMixin, unittest.TestCase):
+
+    def test_handle_credentials(self):
+        # Issue 194: couchdb-load attribute error: 'Resource' object has  
no attribute 'http'
+        # http://code.google.com/p/couchdb-python/issues/detail?id=194
+        load.load_db(StringIO(''), self.db.resource.url, 'foo', 'bar')
+
+
+def suite():
+    suite = unittest.TestSuite()
+    suite.addTest(unittest.makeSuite(ToolLoadTestCase, 'test'))
+    return suite
+
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='suite')
+
=======================================
--- /couchdb/tests/__init__.py  Mon Apr 26 03:53:34 2010
+++ /couchdb/tests/__init__.py  Tue Oct  9 01:04:31 2012
@@ -9,7 +9,7 @@
  import unittest

  from couchdb.tests import client, couch_tests, design, http, multipart, \
-                          mapping, view, package
+                          mapping, view, package, tools

  def suite():
@@ -22,6 +22,7 @@
      suite.addTest(view.suite())
      suite.addTest(couch_tests.suite())
      suite.addTest(package.suite())
+    suite.addTest(tools.suite())
      return suite

=======================================
--- /couchdb/tools/load.py      Thu Feb 25 08:00:38 2010
+++ /couchdb/tools/load.py      Tue Oct  9 01:04:31 2012
@@ -24,7 +24,7 @@
  def load_db(fileobj, dburl, username=None, password=None,  
ignore_errors=False):
      db = Database(dburl)
      if username is not None and password is not None:
-        db.resource.http.add_credentials(username, password)
+        db.resource.credentials = (username, password)

      for headers, is_multipart, payload in read_multipart(fileobj):
          docid = headers['content-id']


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »