1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Change asserts to assertIsInstance for better error messages

This commit is contained in:
Toshio Kuratomi 2015-05-08 13:49:10 -07:00
parent 7f21f270d9
commit f9f8af06fc

View file

@ -60,18 +60,18 @@ class TestBlock(unittest.TestCase):
) )
b = Block.load(ds) b = Block.load(ds)
self.assertEqual(len(b.block), 1) self.assertEqual(len(b.block), 1)
assert isinstance(b.block[0], Task) self.assertIsInstance(b.block[0], Task)
self.assertEqual(len(b.rescue), 1) self.assertEqual(len(b.rescue), 1)
assert isinstance(b.rescue[0], Task) self.assertIsInstance(b.rescue[0], Task)
self.assertEqual(len(b.always), 1) self.assertEqual(len(b.always), 1)
assert isinstance(b.always[0], Task) self.assertIsInstance(b.always[0], Task)
# not currently used # not currently used
#self.assertEqual(len(b.otherwise), 1) #self.assertEqual(len(b.otherwise), 1)
#assert isinstance(b.otherwise[0], Task) #self.assertIsInstance(b.otherwise[0], Task)
def test_load_implicit_block(self): def test_load_implicit_block(self):
ds = [dict(action='foo')] ds = [dict(action='foo')]
b = Block.load(ds) b = Block.load(ds)
self.assertEqual(len(b.block), 1) self.assertEqual(len(b.block), 1)
assert isinstance(b.block[0], Task) self.assertIsInstance(b.block[0], Task)