def testStillClusterNode(self):
    key = "myKey"
    name = "myName"
    ssh.AddPublicKey(name, key, key_file=self._pub_keys_file)
    self._ssconf_mock.GetNodeList.return_value = ["myName", "myOtherNode"]

    self.assertRaises(
        errors.SshUpdateError,
        backend.RemoveSshKeyFromPublicKeyFile,
        name, pub_key_file=self._pub_keys_file,
        ssconf_store=self._ssconf_mock)
Tests the safety check to only remove keys of obsolete nodes.
dataset/ETHPy150Open ganeti/ganeti/test/py/ganeti.backend_unittest.py/TestRemoveSshKeyFromPublicKeyFile.testStillClusterNode