Beispiel #1
0
 def test_delete_repository_success(self):
     self.create_repository()
     test = clicktest.CliRunner()
     result = test.invoke(
                 curator.repo_mgr_cli,
                 [
                     '--logfile', os.devnull,
                     '--host', host,
                     '--port', str(port),
                     'delete',
                     '--yes', # This ensures no prompting will happen
                     '--repository', self.args['repository']
                 ],
                 obj={"filters":[]})
     self.assertFalse(curator.get_repository(self.client, self.args['repository']))
Beispiel #2
0
 def test_delete_repository_success(self):
     self.create_repository()
     self.write_config(
         self.args['configfile'],
         testvars.client_conf_logfile.format(host, port, os.devnull))
     test = clicktest.CliRunner()
     result = test.invoke(
         curator.repo_mgr_cli,
         [
             '--config',
             self.args['configfile'],
             'delete',
             '--yes',  # This ensures no prompting will happen
             '--repository',
             self.args['repository']
         ])
     self.assertFalse(
         curator.get_repository(self.client, self.args['repository']))
Beispiel #3
0
 def test_delete_repository_success(self):
     self.create_repository()
     self.write_config(
         self.args['configfile'],
         testvars.client_conf_logfile.format(host, port, os.devnull)
     )
     test = clicktest.CliRunner()
     result = test.invoke(
                 curator.repo_mgr_cli,
                 [
                     '--config', self.args['configfile'],
                     'delete',
                     '--yes', # This ensures no prompting will happen
                     '--repository', self.args['repository']
                 ]
     )
     self.assertFalse(
         curator.get_repository(self.client, self.args['repository'])
     )
Beispiel #4
0
 def test_get_repository__all_positive(self):
     client = Mock()
     client.snapshot.get_repository.return_value = testvars.test_repos
     self.assertEqual(testvars.test_repos, curator.get_repository(client))
Beispiel #5
0
 def test_get_repository_positive(self):
     client = Mock()
     client.snapshot.get_repository.return_value = testvars.test_repo
     self.assertEqual(
         testvars.test_repo,
         curator.get_repository(client, repository=testvars.repo_name))
Beispiel #6
0
 def test_get_repository_missing_arg(self):
     client = Mock()
     client.snapshot.get_repository.return_value = {}
     self.assertEqual({}, curator.get_repository(client))
Beispiel #7
0
 def test_get_repository__all_positive(self):
     client = Mock()
     client.snapshot.get_repository.return_value = testvars.test_repos
     self.assertEqual(testvars.test_repos, curator.get_repository(client))
Beispiel #8
0
 def test_get_repository_notfounderror_negative(self):
     client = Mock()
     client.snapshot.get_repository.side_effect = elasticsearch.NotFoundError
     self.assertFalse(curator.get_repository(client, repository=testvars.repo_name))
Beispiel #9
0
 def test_get_repository_positive(self):
     client = Mock()
     client.snapshot.get_repository.return_value = testvars.test_repo
     self.assertEqual(testvars.test_repo, curator.get_repository(client, repository=testvars.repo_name))
Beispiel #10
0
 def test_get_repository_missing_arg(self):
     client = Mock()
     client.snapshot.get_repository.return_value = {}
     self.assertEqual({}, curator.get_repository(client))
Beispiel #11
0
 def test_get_repository_notfounderror_negative(self):
     client = Mock()
     client.snapshot.get_repository.side_effect = elasticsearch.NotFoundError
     self.assertFalse(
         curator.get_repository(client, repository=testvars.repo_name))