jiridanek commented on a change in pull request #782:
URL: https://github.com/apache/qpid-dispatch/pull/782#discussion_r459761068
##########
File path: tests/system_tests_qdstat.py
##########
@@ -66,24 +66,33 @@ def test_help(self):
def test_general(self):
out = self.run_qdstat(['--general'], r'(?s)Router
Statistics.*Mode\s*Standalone')
- self.assertTrue("Connections 1" in out)
- self.assertTrue("Nodes 0" in out)
- self.assertTrue("Auto Links 0" in out)
- self.assertTrue("Link Routes 0" in out)
- self.assertTrue("Worker Threads 1" in out)
- self.assertTrue("Router Id QDR.A" in out)
- self.assertTrue("Mode standalone" in out)
+
+ self.assertTrue(re.match(r"(.*)\bConnections\b[ \t]+\b1\b(.*)",
+ out, flags=re.DOTALL) is not None, out)
Review comment:
There's `assertRegexpMatches` in Python 2.7 and unittest2. It does
`re.search()` which is a better fit here (avoids having to put `.*` at the
beginning and the end) and should give better assertion failure messages.
https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRegex
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]