qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [03/15] qpid-proton git commit: PROTON-1060: API call types for some message properties do not match AMQP specification
Date Thu, 07 Jan 2016 22:29:13 GMT
PROTON-1060: API call types for some message properties do not match AMQP specification


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

Branch: refs/heads/go1
Commit: 181bb4bd197a90a30a6b5feb9118989eeec7d120
Parents: 253bdaf
Author: Kim van der Riet <kpvdr@apache.org>
Authored: Tue Jan 5 10:54:23 2016 -0500
Committer: Kim van der Riet <kpvdr@apache.org>
Committed: Tue Jan 5 10:54:23 2016 -0500

----------------------------------------------------------------------
 proton-c/bindings/python/proton/__init__.py | 20 ++++++++++----------
 tests/python/proton_tests/message.py        |  9 ++++++---
 2 files changed, 16 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/181bb4bd/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 f3a8e8d..d6106d1 100644
--- a/proton-c/bindings/python/proton/__init__.py
+++ b/proton-c/bindings/python/proton/__init__.py
@@ -984,10 +984,10 @@ The address of the message.
 """)
 
   def _get_subject(self):
-    return pn_message_get_subject(self._msg)
+    return utf82unicode(pn_message_get_subject(self._msg))
 
   def _set_subject(self, value):
-    self._check(pn_message_set_subject(self._msg, value))
+    self._check(pn_message_set_subject(self._msg, unicode2utf8(value)))
 
   subject = property(_get_subject, _set_subject,
                      doc="""
@@ -1019,10 +1019,10 @@ The correlation-id for the message.
 """)
 
   def _get_content_type(self):
-    return pn_message_get_content_type(self._msg)
+    return symbol(utf82unicode(pn_message_get_content_type(self._msg)))
 
   def _set_content_type(self, value):
-    self._check(pn_message_set_content_type(self._msg, value))
+    self._check(pn_message_set_content_type(self._msg, unicode2utf8(value)))
 
   content_type = property(_get_content_type, _set_content_type,
                           doc="""
@@ -1030,10 +1030,10 @@ The content-type of the message.
 """)
 
   def _get_content_encoding(self):
-    return pn_message_get_content_encoding(self._msg)
+    return symbol(utf82unicode(pn_message_get_content_encoding(self._msg)))
 
   def _set_content_encoding(self, value):
-    self._check(pn_message_set_content_encoding(self._msg, value))
+    self._check(pn_message_set_content_encoding(self._msg, unicode2utf8(value)))
 
   content_encoding = property(_get_content_encoding, _set_content_encoding,
                               doc="""
@@ -1063,10 +1063,10 @@ The creation time of the message.
 """)
 
   def _get_group_id(self):
-    return pn_message_get_group_id(self._msg)
+    return utf82unicode(pn_message_get_group_id(self._msg))
 
   def _set_group_id(self, value):
-    self._check(pn_message_set_group_id(self._msg, value))
+    self._check(pn_message_set_group_id(self._msg, unicode2utf8(value)))
 
   group_id = property(_get_group_id, _set_group_id,
                       doc="""
@@ -1085,10 +1085,10 @@ The sequence of the message within its group.
 """)
 
   def _get_reply_to_group_id(self):
-    return pn_message_get_reply_to_group_id(self._msg)
+    return utf82unicode(pn_message_get_reply_to_group_id(self._msg))
 
   def _set_reply_to_group_id(self, value):
-    self._check(pn_message_set_reply_to_group_id(self._msg, value))
+    self._check(pn_message_set_reply_to_group_id(self._msg, unicode2utf8(value)))
 
   reply_to_group_id = property(_get_reply_to_group_id, _set_reply_to_group_id,
                                doc="""

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/181bb4bd/tests/python/proton_tests/message.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/message.py b/tests/python/proton_tests/message.py
index 7aa9fac..2d6e19e 100644
--- a/tests/python/proton_tests/message.py
+++ b/tests/python/proton_tests/message.py
@@ -45,8 +45,11 @@ class AccessorsTest(Test):
       gotten = getattr(self.msg, name)
       assert gotten == v, gotten
 
+  def _test_symbol(self, name):
+    self._test(name, symbol(None), (symbol(u"abc.123.#$%"), symbol(u"hello.world")))
+
   def _test_str(self, name):
-    self._test(name, None, ("asdf", "fdsa", ""))
+    self._test(name, None, (u"asdf", u"fdsa", u""))
 
   def _test_time(self, name):
     self._test(name, 0, (0, 123456789, 987654321))
@@ -86,10 +89,10 @@ class AccessorsTest(Test):
     self._test_str("reply_to")
 
   def testContentType(self):
-    self._test_str("content_type")
+    self._test_symbol("content_type")
 
   def testContentEncoding(self):
-    self._test_str("content_encoding")
+    self._test_symbol("content_encoding")
 
   def testExpiryTime(self):
     self._test_time("expiry_time")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message