asfgit closed pull request #437: DISPATCH-1239 - Modified system tests to work 
with python2.6
URL: https://github.com/apache/qpid-dispatch/pull/437
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tests/system_tests_address_lookup.py 
b/tests/system_tests_address_lookup.py
index a69886c1..fa2bf434 100644
--- a/tests/system_tests_address_lookup.py
+++ b/tests/system_tests_address_lookup.py
@@ -272,17 +272,14 @@ def test_lookup_bad_connection(self):
         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 3ce9cf16..16614f72 100644
--- a/tests/system_tests_qdstat.py
+++ b/tests/system_tests_qdstat.py
@@ -92,22 +92,22 @@ def test_address_priority(self):
         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 @@ def test_link_priority(self):
         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 @@ def test_link_priority(self):
             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


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to