def test_delete_oozie_password(self, delete_secret): cluster = mock.MagicMock() cluster.extra.to_dict = mock.MagicMock() cluster.extra.to_dict.return_value = {} u.delete_oozie_password(cluster) delete_secret.assert_not_called() cluster.extra.to_dict.return_value = {"oozie_pass_id": "31415926"} u.delete_oozie_password(cluster) delete_secret.assert_called_once_with("31415926")
def on_terminate_cluster(self, cluster): u.delete_oozie_password(cluster) keypairs.drop_key(cluster)