Exemplo n.º 1
0
 def test_get_snapshot_notfounderror_negative(self):
     client = Mock()
     client.snapshot.get_repository.return_value = test_repo
     client.snapshot.get.side_effect = elasticsearch.NotFoundError
     self.assertFalse(
         curator.get_snapshot(client,
                              repository=repo_name,
                              snapshot=snap_name))
Exemplo n.º 2
0
 def test_get_snapshot_positive(self):
     client = Mock()
     client.snapshot.get.return_value = snapshot
     self.assertEqual(
         snapshot,
         curator.get_snapshot(client,
                              repository=repo_name,
                              snapshot=snap_name))
Exemplo n.º 3
0
 def test_get_snapshot_missing_repository_arg(self):
     client = Mock()
     self.assertFalse(curator.get_snapshot(client, snapshot=snap_name))
Exemplo n.º 4
0
 def test_get_snapshot_notfounderror_negative(self):
     client = Mock()
     client.snapshot.get_repository.return_value = test_repo
     client.snapshot.get.side_effect = elasticsearch.NotFoundError
     self.assertFalse(curator.get_snapshot(client, repository=repo_name, snapshot=snap_name))
Exemplo n.º 5
0
 def test_get_snapshot_positive(self):
     client = Mock()
     client.snapshot.get.return_value = snapshot
     self.assertEqual(snapshot, curator.get_snapshot(client, repository=repo_name, snapshot=snap_name))
Exemplo n.º 6
0
 def test_get_snapshot_missing_repository_arg(self):
     client = Mock()
     self.assertFalse(curator.get_snapshot(client, snapshot=snap_name))