Skip to content

Commit 91688d5

Browse files
John Huggmeta-codesync[bot]
authored andcommitted
Use membership assertions in stats tests
Summary: Replace boolean containment assertions in the mcrouter stats test with unittest's dedicated assertIn helper. This is a mechanical test-quality cleanup with no behavior change. Reviewed By: ghostonhuang Differential Revision: D112955721 fbshipit-source-id: 489a6454969ef4044ce3dfd1ea9aba292a8bf099
1 parent b9e97a5 commit 91688d5

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

mcrouter/test/test_mcrouter_basic.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,21 @@ def test_stats(self):
7878
args = ["detailed", "cmd-error", "servers", "suspect_servers", "count"]
7979
for arg in args:
8080
res = mcr.issue_command_and_read_all(f"stats{arg}\r\n")
81-
self.assertTrue("CLIENT_ERROR" in res)
81+
self.assertIn("CLIENT_ERROR", res)
8282
res = mcr.issue_command_and_read_all(f"stats {arg}\r\n")
83-
self.assertTrue("END" in res)
83+
self.assertIn("END", res)
8484
res = mcr.issue_command_and_read_all(f"stats {arg} \r\n")
85-
self.assertTrue("END" in res)
85+
self.assertIn("END", res)
8686
res = mcr.issue_command_and_read_all(f"stats{arg}\n")
87-
self.assertTrue("CLIENT_ERROR" in res)
87+
self.assertIn("CLIENT_ERROR", res)
8888
res = mcr.issue_command_and_read_all(f"stats {arg}\n")
89-
self.assertTrue("END" in res)
89+
self.assertIn("END", res)
9090
res = mcr.issue_command_and_read_all(f"stats {arg} \n")
91-
self.assertTrue("END" in res)
91+
self.assertIn("END", res)
9292

9393
# Stats with invalid arg
9494
res = mcr.issue_command_and_read_all("stats invalid_option\r\n")
95-
self.assertTrue("CLIENT_ERROR" in res)
95+
self.assertIn("CLIENT_ERROR", res)
9696

9797
def test_stats_deadlock(self):
9898
mcr = self.get_mcrouter(["--proxy-threads=8"])

0 commit comments

Comments
 (0)