mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
[FactCache] define first_order_merge method (#55781)
* Add first_order_merge method Add test for updating a key that already exists * changelog
This commit is contained in:
6
test/units/plugins/cache/test_cache.py
vendored
6
test/units/plugins/cache/test_cache.py
vendored
@@ -117,6 +117,12 @@ class TestFactCache(unittest.TestCase):
|
||||
"Unable to load the facts cache plugin.*json.*",
|
||||
FactCache)
|
||||
|
||||
def test_update_legacy_key_exists(self):
|
||||
self.cache['cache_key'] = {'key': 'value', 'key2': 'value2'}
|
||||
self.cache.update('cache_key', {'key': 'updatedvalue'})
|
||||
assert self.cache['cache_key']['key'] == 'updatedvalue'
|
||||
assert self.cache['cache_key']['key2'] == 'value2'
|
||||
|
||||
|
||||
class TestAbstractClass(unittest.TestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user