PROTON-878: set password connection property correctly

Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/9272dea2
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/9272dea2
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/9272dea2

Branch: refs/heads/kgiusti-python3
Commit: 9272dea26474450fe6098377ae43b662ee315997
Parents: aec0cac
Author: Ken Giusti <[email protected]>
Authored: Tue May 5 09:39:42 2015 -0400
Committer: Ken Giusti <[email protected]>
Committed: Tue May 5 09:39:42 2015 -0400

----------------------------------------------------------------------
 proton-c/bindings/python/proton/__init__.py |  2 +-
 tests/python/proton_tests/engine.py         | 25 +++++++++++++++++++++---
 2 files changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9272dea2/proton-c/bindings/python/proton/__init__.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/__init__.py 
b/proton-c/bindings/python/proton/__init__.py
index 8a9d857..4528957 100644
--- a/proton-c/bindings/python/proton/__init__.py
+++ b/proton-c/bindings/python/proton/__init__.py
@@ -2413,7 +2413,7 @@ class Connection(Wrapper, Endpoint):
   def _set_password(self, name):
     return pn_connection_set_password(self._impl, unicode2utf8(name))
 
-  user = property(_get_password, _set_password)
+  password = property(_get_password, _set_password)
 
   @property
   def remote_container(self):

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9272dea2/tests/python/proton_tests/engine.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/engine.py 
b/tests/python/proton_tests/engine.py
index 2d2b8cd..05c8e19 100644
--- a/tests/python/proton_tests/engine.py
+++ b/tests/python/proton_tests/engine.py
@@ -18,11 +18,13 @@
 #
 
 import os, common, gc
+import sys
 from time import time, sleep
 from proton import *
-from common import pump
+from common import pump, Skipped
 from proton.reactor import Reactor
 
+
 # older versions of gc do not provide the garbage list
 if not hasattr(gc, "garbage"):
   gc.garbage=[]
@@ -232,6 +234,25 @@ class ConnectionTest(Test):
     pump(t1, t2)
     assert c2.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED
 
+  def test_user_config(self):
+    if "java" in sys.platform:
+      raise Skipped("Unsupported API")
+
+    self.c1.user = "vindaloo"
+    self.c1.password = "secret"
+    self.c1.open()
+    self.pump()
+
+    self.c2.user = "leela"
+    self.c2.password = "trustno1"
+    self.c2.open()
+    self.pump()
+
+    assert self.c1.user == "vindaloo", self.c1.user
+    assert self.c1.password == None, self.c1.password
+    assert self.c2.user == "leela", self.c2.user
+    assert self.c2.password == None, self.c2.password
+
 class SessionTest(Test):
 
   def setup(self):
@@ -1845,8 +1866,6 @@ class PipelineTest(Test):
 
     assert rcv.queued == 0, rcv.queued
 
-import sys
-from common import Skipped
 
 class ServerTest(Test):
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to