From: Douglas Bagnall Date: Fri, 9 Mar 2018 02:20:53 +0000 (+1300) Subject: sambatool tests: make assertMatch use assertIn X-Git-Tag: ldb-1.4.0~392 X-Git-Url: http://git.samba.org/samba.git/?p=nivanova%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=2c6cac990e64983c7fdb5beb3316ef956fa0b0bc;hp=ac053b1493157c752d7c7c802e95b5222d61b71c sambatool tests: make assertMatch use assertIn With a note to tidy this up at some point Signed-off-by: Douglas Bagnall Reviewed-by: Gary Lockyer --- diff --git a/python/samba/tests/samba_tool/base.py b/python/samba/tests/samba_tool/base.py index de257e3db09..89a09225e64 100644 --- a/python/samba/tests/samba_tool/base.py +++ b/python/samba/tests/samba_tool/base.py @@ -96,10 +96,11 @@ class SambaToolCmdTest(samba.tests.BlackboxTestCase): self.assertIsNotNone(val, msg) def assertMatch(self, base, string, msg=None): + # Note: we should stop doing this and just use self.assertIn() if msg is None: msg = "%r is not in %r" % (truncate_string(string), truncate_string(base)) - self.assertTrue(string in base, msg) + self.assertIn(string, base, msg) def randomName(self, count=8): """Create a random name, cap letters and numbers, and always starting with a letter"""