Improve testing of FactCache (#55739)

* Improve testing of FactCache
pull/57659/head
Enno Gröper 5 years ago committed by Sloane Hertel
parent a8e133105c
commit 1ed7a654ba

@ -117,6 +117,14 @@ class TestFactCache(unittest.TestCase):
"Unable to load the facts cache plugin.*json.*",
FactCache)
def test_update(self):
self.cache.update({'cache_key': {'key2': 'updatedvalue'}})
assert self.cache['cache_key']['key2'] == 'updatedvalue'
def test_update_legacy(self):
self.cache.update('cache_key', {'key2': 'updatedvalue'})
assert self.cache['cache_key']['key2'] == 'updatedvalue'
def test_update_legacy_key_exists(self):
self.cache['cache_key'] = {'key': 'value', 'key2': 'value2'}
self.cache.update('cache_key', {'key': 'updatedvalue'})

Loading…
Cancel
Save