mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
Fix uninitialized variable in deserialize method (#18037)
The bug was introduced with commit 06d4f4ad0e
.
Added a simple test.
This commit is contained in:
parent
0a60cceaf0
commit
cf0da0948d
2 changed files with 12 additions and 1 deletions
|
@ -75,3 +75,14 @@ class TestBlock(unittest.TestCase):
|
|||
self.assertEqual(len(b.block), 1)
|
||||
self.assertIsInstance(b.block[0], Task)
|
||||
|
||||
def test_deserialize(self):
|
||||
ds = dict(
|
||||
block = [dict(action='block')],
|
||||
rescue = [dict(action='rescue')],
|
||||
always = [dict(action='always')],
|
||||
)
|
||||
b = Block.load(ds)
|
||||
data = dict(parent = ds, parent_type = 'Block')
|
||||
b.deserialize(data)
|
||||
self.assertIsInstance(b._parent, Block)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue