def test_config_show_fail(self, mock_file_exists, mock_warn, mock_abort): mock_file_exists.return_value = False env.host = "any_host" configure_cmds.configuration_show("any_path") file_path = os.path.join(constants.REMOTE_CONF_DIR, "any_path") mock_warn.assert_called_with("No configuration file found " "for %s at %s" % (env.host, file_path)) configure_cmds.show("invalid_config") mock_abort.assert_called_with("Invalid Argument. Possible values: " "node, jvm, config, log")
def test_config_show_fail_no_warn(self, mock_file_exists, mock_warn): mock_file_exists.return_value = False env.host = "any_host" configure_cmds.configuration_show("any_path", should_warn=False) self.assertFalse(mock_warn.called)