Exemple #1
0
 def test_no_action(self):
     self.write_config(self.args['configfile'],
                       testvars.client_config.format(host, port))
     self.write_config(self.args['actionfile'], testvars.actionless_proto)
     test = clicktest.CliRunner()
     result = test.invoke(
         curator.cli,
         ['--config', self.args['configfile'], self.args['actionfile']],
     )
     self.assertEqual(type(curator.ConfigurationError()),
                      type(result.exception))
Exemple #2
0
 def test_filter_by_alias_bad_aliases(self):
     alias = 'testalias'
     self.write_config(self.args['configfile'],
                       testvars.client_config.format(host, port))
     self.write_config(
         self.args['actionfile'],
         testvars.filter_by_alias.format('{"this":"isadict"}', False))
     self.create_index('my_index')
     self.create_index('dummy')
     self.client.indices.put_alias(index='dummy', name=alias)
     test = clicktest.CliRunner()
     result = test.invoke(
         curator.cli,
         ['--config', self.args['configfile'], self.args['actionfile']],
     )
     self.assertEquals(type(curator.ConfigurationError()),
                       type(result.exception))
     self.assertEquals(2, len(curator.get_indices(self.client)))