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
This commit is contained in:
parent
890e2bfa90
commit
573c52bb1c
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user