You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2019/01/09 20:25:16 UTC
[qpid-dispatch] branch master updated: DISPATCH-1239 - Modified
system tests to work with python2.6
This is an automated email from the ASF dual-hosted git repository.
kgiusti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/master by this push:
new aaa12bd DISPATCH-1239 - Modified system tests to work with python2.6
new 44a41cb Merge branch 'fgiorgetti-DISPATCH-1239' of https://github.com/fgiorgetti/qpid-dispatch into fgiorgetti-fgiorgetti-DISPATCH-1239
aaa12bd is described below
commit aaa12bddbd12d92b373554bebe6c0bd36856141a
Author: Fernando Giorgetti <fg...@redhat.com>
AuthorDate: Mon Jan 7 17:18:16 2019 -0200
DISPATCH-1239 - Modified system tests to work with python2.6
---
tests/system_tests_address_lookup.py | 9 +++------
tests/system_tests_qdstat.py | 20 ++++++++++----------
2 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/tests/system_tests_address_lookup.py b/tests/system_tests_address_lookup.py
index a69886c..fa2bf43 100644
--- a/tests/system_tests_address_lookup.py
+++ b/tests/system_tests_address_lookup.py
@@ -272,17 +272,14 @@ class LinkRouteLookupTest(TestCase):
Verify that clients connected via non-edge connections fail
"""
bc = BlockingConnection(self.INT_A.listener, timeout=TIMEOUT)
- with self.assertRaises(LinkDetached):
- SyncRequestResponse(bc, self.QD_TERMINUS_ADDRESS_LOOKUP)
+ self.assertRaises(LinkDetached, SyncRequestResponse, bc, self.QD_TERMINUS_ADDRESS_LOOKUP)
bc.close()
bc = BlockingConnection(self.INT_A.inter_router_listener, timeout=TIMEOUT)
- with self.assertRaises(LinkDetached):
- SyncRequestResponse(bc, self.QD_TERMINUS_ADDRESS_LOOKUP)
+ self.assertRaises(LinkDetached, SyncRequestResponse, bc, self.QD_TERMINUS_ADDRESS_LOOKUP)
bc.close()
# consuming from the lookup address is forbidden:
bc = BlockingConnection(self.INT_A.edge_listener, timeout=TIMEOUT)
- with self.assertRaises(LinkDetached):
- rcv = bc.create_receiver(self.QD_TERMINUS_ADDRESS_LOOKUP)
+ self.assertRaises(LinkDetached, bc.create_receiver, self.QD_TERMINUS_ADDRESS_LOOKUP)
bc.close()
diff --git a/tests/system_tests_qdstat.py b/tests/system_tests_qdstat.py
index 3ce9cf1..16614f7 100644
--- a/tests/system_tests_qdstat.py
+++ b/tests/system_tests_qdstat.py
@@ -92,22 +92,22 @@ class QdstatTest(system_test.TestCase):
lines = out.split("\n")
# make sure the output contains a header line
- self.assertGreaterEqual(len(lines), 2)
+ self.assertTrue(len(lines) >= 2)
# see if the header line has the word priority in it
priorityregexp = r'pri'
priority_column = re.search(priorityregexp, lines[1]).start()
- self.assertGreater(priority_column, -1)
+ self.assertTrue(priority_column > -1)
# extract the number in the priority column of every address
for i in range(3, len(lines) - 1):
pri = re.findall('\d+', lines[i][priority_column:])
# make sure the priority found is a number
- self.assertGreater(len(pri), 0, "Can not find numeric priority in '%s'" % lines[i])
+ self.assertTrue(len(pri) > 0, "Can not find numeric priority in '%s'" % lines[i])
priority = int(pri[0])
# make sure the priority is from -1 to 9
- self.assertGreaterEqual(priority, -1, "Priority was less than -1")
- self.assertLessEqual(priority, 9, "Priority was greater than 9")
+ self.assertTrue(priority >= -1, "Priority was less than -1")
+ self.assertTrue(priority <= 9, "Priority was greater than 9")
def test_address_with_limit(self):
out = self.run_qdstat(['--address', '--limit=1'])
@@ -164,12 +164,12 @@ class QdstatLinkPriorityTest(system_test.TestCase):
lines = out.split("\n")
# make sure the output contains a header line
- self.assertGreaterEqual(len(lines), 2)
+ self.assertTrue(len(lines) >= 2)
# see if the header line has the word priority in it
priorityregexp = r'pri'
priority_column = re.search(priorityregexp, lines[1]).start()
- self.assertGreater(priority_column, -1)
+ self.assertTrue(priority_column > -1)
# extract the number in the priority column of every inter-router link
priorities = {}
@@ -177,11 +177,11 @@ class QdstatLinkPriorityTest(system_test.TestCase):
if re.search(r'inter-router', lines[i]):
pri = re.findall('\d+', lines[i][priority_column:])
# make sure the priority found is a number
- self.assertGreater(len(pri), 0, "Can not find numeric priority in '%s'" % lines[i])
+ self.assertTrue(len(pri) > 0, "Can not find numeric priority in '%s'" % lines[i])
priority = int(pri[0])
# make sure the priority is from 0 to 9
- self.assertGreaterEqual(priority, 0, "Priority was less than 0")
- self.assertLessEqual(priority, 9, "Priority was greater than 9")
+ self.assertTrue(priority >= 0, "Priority was less than 0")
+ self.assertTrue(priority <= 9, "Priority was greater than 9")
# mark this priority as present
priorities[priority] = True
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org