[
https://issues.apache.org/jira/browse/DISPATCH-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17164005#comment-17164005
]
ASF GitHub Bot commented on DISPATCH-1722:
------------------------------------------
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]
> system_tests_qdstat fails when checking for presence Worker Threads
> -------------------------------------------------------------------
>
> Key: DISPATCH-1722
> URL: https://issues.apache.org/jira/browse/DISPATCH-1722
> Project: Qpid Dispatch
> Issue Type: Bug
> Components: Tests
> Affects Versions: 1.12.0
> Reporter: Ganesh Murthy
> Priority: Major
>
> {noformat}
> 30: ======================================================================
> 30: FAIL: test_general (system_tests_qdstat.QdstatTest)
> 30: ----------------------------------------------------------------------
> 30: Traceback (most recent call last):
> 30: File
> "/home/travis/build/apache/qpid-dispatch/tests/system_tests_qdstat.py", line
> 73, in test_general
> 30: self.assertTrue("Worker Threads 1" in out)
> 30: AssertionError: False is not true {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]