Rev 465: Use right order of parameters to SubversionException(). in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Sun May 27 17:14:27 BST 2007


At http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

------------------------------------------------------------
revno: 465
revision-id: jelmer at samba.org-20070527161422-yub39px85sn7i44y
parent: jelmer at samba.org-20070527145252-d5bqmu83eocgt69y
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Sun 2007-05-27 18:14:22 +0200
message:
  Use right order of parameters to SubversionException().
modified:
  errors.py                      errors.py-20061226172623-w1sbj8ynpo0eojqp-1
  tests/test_errors.py           test_errors.py-20070129114605-ban03f32t6ja14ez-1
=== modified file 'errors.py'
--- a/errors.py	2007-05-18 15:11:30 +0000
+++ b/errors.py	2007-05-27 16:14:22 +0000
@@ -30,7 +30,7 @@
 
 
 def convert_error(err):
-    (num, msg) = err.args
+    (msg, num) = err.args
 
     if num == svn.core.SVN_ERR_RA_SVN_CONNECTION_CLOSED:
         return ConnectionReset(msg=msg)

=== modified file 'tests/test_errors.py'
--- a/tests/test_errors.py	2007-05-05 14:16:53 +0000
+++ b/tests/test_errors.py	2007-05-27 16:14:22 +0000
@@ -26,14 +26,14 @@
     def test_decorator_unknown(self):
         @convert_svn_error
         def test_throws_svn():
-            raise SubversionException(100, "foo")
+            raise SubversionException("foo", 100)
 
         self.assertRaises(SubversionException, test_throws_svn)
 
     def test_decorator_known(self):
         @convert_svn_error
         def test_throws_svn():
-            raise SubversionException(svn.core.SVN_ERR_RA_SVN_CONNECTION_CLOSED, "Connection closed")
+            raise SubversionException("Connection closed", svn.core.SVN_ERR_RA_SVN_CONNECTION_CLOSED)
 
         self.assertRaises(ConnectionReset, test_throws_svn)
 
@@ -42,10 +42,10 @@
                 SubversionException)
 
     def test_convert_error_reset(self):
-        self.assertIsInstance(convert_error(SubversionException(svn.core.SVN_ERR_RA_SVN_CONNECTION_CLOSED, "Connection closed")), ConnectionReset)
+        self.assertIsInstance(convert_error(SubversionException("Connection closed", svn.core.SVN_ERR_RA_SVN_CONNECTION_CLOSED)), ConnectionReset)
 
     def test_convert_error_lock(self):
-        self.assertIsInstance(convert_error(SubversionException(svn.core.SVN_ERR_WC_LOCKED, "Working copy locked")), LockError)
+        self.assertIsInstance(convert_error(SubversionException("Working copy locked", svn.core.SVN_ERR_WC_LOCKED)), LockError)
 
     def test_decorator_nothrow(self):
         @convert_svn_error




More information about the bazaar-commits mailing list