예제 #1
0
 def test_check_master_negative(self):
     client = Mock()
     client.nodes.info.return_value = {'nodes': {"bad": "mojo"}}
     client.cluster.state.return_value = {"master_node": "foo"}
     with self.assertRaises(SystemExit) as cm:
         curator.check_master(client, master_only=True)
     self.assertEqual(cm.exception.code, 0)
예제 #2
0
 def test_check_master_negative(self):
     client = Mock()
     client.nodes.info.return_value = {
         'nodes': { "bad" : "mojo"}
     }
     client.cluster.state.return_value = {
         "master_node" : "foo"
     }
     with self.assertRaises(SystemExit) as cm:
         curator.check_master(client, master_only=True)
     self.assertEqual(cm.exception.code, 0)
예제 #3
0
 def test_check_master_positive(self):
     client = Mock()
     client.nodes.info.return_value = {
         'nodes': { "foo" : "bar"}
     }
     client.cluster.state.return_value = {
         "master_node" : "foo"
     }
     self.assertIsNone(curator.check_master(client, master_only=True))
예제 #4
0
 def test_check_master_positive(self):
     client = Mock()
     client.nodes.info.return_value = {
         'nodes': { "foo" : "bar"}
     }
     client.cluster.state.return_value = {
         "master_node" : "foo"
     }
     self.assertIsNone(curator.check_master(client, master_only=True))