def test_delete_snapshot_negative(self): client = Mock() client.snapshot.delete.side_effect = elasticsearch.RequestError self.assertFalse( curator.delete_snapshot(client, repository=repo_name, snapshot=snap_name))
def test_delete_snapshot_positive(self): client = Mock() client.snapshot.delete.return_value = None self.assertTrue( curator.delete_snapshot(client, repository=repo_name, snapshot=snap_name))
def test_delete_snapshot_negative(self): client = Mock() client.snapshot.delete.side_effect = elasticsearch.RequestError self.assertFalse(curator.delete_snapshot(client, repository=repo_name, snapshot=snap_name))
def test_delete_snapshot_positive(self): client = Mock() client.snapshot.delete.return_value = None self.assertTrue(curator.delete_snapshot(client, repository=repo_name, snapshot=snap_name))
def test_delete_snapshot_snapshot_is_list(self): client = Mock() self.assertFalse(curator.delete_snapshot(client, repository=repo_name, snapshot=['snap1', 'snap2']))
def test_delete_snapshot_missing_arg_name(self): client = Mock() self.assertFalse(curator.delete_snapshot(client, repository=repo_name))
def test_delete_snapshot_negative(self): client = Mock() client.snapshot.delete.side_effect = elasticsearch.TransportError(400, 'This is an error message') self.assertFalse(curator.delete_snapshot(client, repository=repo_name, snapshot=snap_name))