def test_upgrade_charm_with_nrpe_relation_installs_dependencies(
self,
mock_config):
config = copy.deepcopy(CHARM_CONFIG)
mock_config.side_effect = lambda key: config[key]
with patch.multiple(
ceph_hooks,
apt_install=DEFAULT,
rsync=DEFAULT,
log=DEFAULT,
write_file=DEFAULT,
nrpe=DEFAULT,
emit_cephconf=DEFAULT,
mon_relation_joined=DEFAULT,
is_relation_made=DEFAULT) as mocks, patch(
"charmhelpers.contrib.hardening.harden.config"):
mocks["is_relation_made"].return_value = True
ceph_hooks.upgrade_charm()
mocks["apt_install"].assert_called_with(
["python-dbus", "lockfile-progs"])
评论列表
文章目录