コード例 #1
0
ファイル: test_api_utils.py プロジェクト: tarjei/curator
 def test_get_snapshots_notfounderror_negative(self):
     client = Mock()
     client.snapshot.get_repository.return_value = test_repo
     client.snapshot.get.side_effect = elasticsearch.NotFoundError
     self.assertFalse(curator.get_snapshots(client, repository=repo_name))
コード例 #2
0
ファイル: test_api_utils.py プロジェクト: tarjei/curator
 def test_get_snapshots_multiple_positive(self):
     client = Mock()
     client.snapshot.get.return_value = snapshots
     self.assertEqual(['snap_name', 'snapshot2'],
                      curator.get_snapshots(client, repository=repo_name))
コード例 #3
0
ファイル: test_api_utils.py プロジェクト: tarjei/curator
 def test_get_snapshots_missing_repository_arg(self):
     client = Mock()
     self.assertFalse(curator.get_snapshots(client))
コード例 #4
0
 def test_get_snapshots_notfounderror_negative(self):
     client = Mock()
     client.snapshot.get_repository.return_value = test_repo
     client.snapshot.get.side_effect = elasticsearch.NotFoundError
     self.assertFalse(curator.get_snapshots(client, repository=repo_name))
コード例 #5
0
 def test_get_snapshots_multiple_positive(self):
     client = Mock()
     client.snapshot.get.return_value = snapshots
     self.assertEqual(['snap_name', 'snapshot2'], curator.get_snapshots(client, repository=repo_name))
コード例 #6
0
 def test_get_snapshots_missing_repository_arg(self):
     client = Mock()
     self.assertFalse(curator.get_snapshots(client))