def METHOD_NAME(self):
    # Create empty private key file
    private_key_path = self._create_new_temp_key_file("")
    # Write encrypted / passworded key into file
    self.key.write_private_key_file(private_key_path, password="test")
    # Check that CLIError exception is raised when generate_ssh_keys is called.
    with self.assertRaises(CLIError):
        public_key_path = private_key_path + ".pub"
        generate_ssh_keys(private_key_path, public_key_path)