From 573c52bb1c4f67e49bcacd1c1ce5c2af672e0f76 Mon Sep 17 00:00:00 2001 From: melissaml Date: Fri, 14 Oct 2016 10:17:18 +0800 Subject: [PATCH] Change assertTrue(isinstance()) by optimal assert Some of tests use different method of assertTrue(isinstance(A, B)) or assertEqual(type(A), B). The correct way is to use assertIsInstance(A, B) provided by testtools Change-Id: Ia5156aef65da766520485bbc9495b61918407f22 --- oslo_policy/tests/test_policy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oslo_policy/tests/test_policy.py b/oslo_policy/tests/test_policy.py index dc3ede78..6b077bf9 100644 --- a/oslo_policy/tests/test_policy.py +++ b/oslo_policy/tests/test_policy.py @@ -772,7 +772,7 @@ class BaseCheckTypesTestCase(base.PolicyBaseTestCase): class RuleDefaultTestCase(base.PolicyBaseTestCase): def test_rule_is_parsed(self): opt = policy.RuleDefault(name='foo', check_str='rule:foo') - self.assertTrue(isinstance(opt.check, _checks.BaseCheck)) + self.assertIsInstance(opt.check, _checks.BaseCheck) self.assertEqual('rule:foo', str(opt.check)) def test_str(self):