You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2019/04/15 21:50:17 UTC
[qpid-proton] branch master updated: PROTON-2034: [Python] Fix some
small infelicities in fix - Tests should not be using internal (non
exported ) API
This is an automated email from the ASF dual-hosted git repository.
astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
The following commit(s) were added to refs/heads/master by this push:
new b65bcf7 PROTON-2034: [Python] Fix some small infelicities in fix - Tests should not be using internal (non exported ) API
b65bcf7 is described below
commit b65bcf7b8c09c655eafe86e4a21e39ae3b7277f4
Author: Andrew Stitcher <as...@apache.org>
AuthorDate: Mon Apr 15 17:48:15 2019 -0400
PROTON-2034: [Python] Fix some small infelicities in fix
- Tests should not be using internal (non exported ) API
---
python/proton/_common.py | 4 ----
python/tests/proton_tests/reactor.py | 8 +++-----
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/python/proton/_common.py b/python/proton/_common.py
index 38cdfcf..d64f408 100644
--- a/python/proton/_common.py
+++ b/python/proton/_common.py
@@ -88,7 +88,3 @@ def utf82unicode(string):
# py2 str (via hack definition), py3 bytes
return string.decode('utf8')
raise TypeError("Unrecognized string type")
-
-def isutf8(string):
- """Test if a string is unicode"""
- return isinstance(string, unicode) # py2 unicode, py3 str (via hack definition)
diff --git a/python/tests/proton_tests/reactor.py b/python/tests/proton_tests/reactor.py
index 2483e0f..1586d45 100644
--- a/python/tests/proton_tests/reactor.py
+++ b/python/tests/proton_tests/reactor.py
@@ -23,9 +23,7 @@ import time
from proton.reactor import Container, ApplicationEvent, EventInjector, Selector
from proton.handlers import Handshaker, MessagingHandler
-from proton import Handler, Url
-from proton._data import symbol
-from proton._common import isutf8
+from proton import Handler, Url, symbol
from .common import Test, SkipTest, TestServer, free_tcp_port, ensureCanTestExtendedSASL
@@ -506,7 +504,7 @@ class SelectorTest(Test):
"""Test the Selector"""
def test_unicode_selector(self):
- assert(isutf8(Selector(u"Hello").filter_set[symbol('selector')].value))
+ assert Selector(u"Hello").filter_set[symbol('selector')].value == u"Hello"
def test_non_unicode_selector(self):
- assert(isutf8(Selector(b"Hello").filter_set[symbol('selector')].value))
+ assert Selector(b"Hello").filter_set[symbol('selector')].value == u"Hello"
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org