def test_negative(self):
     client = Mock()
     client.nodes.info.return_value = {
         'nodes': { "bad" : "mojo"}
     }
     client.cluster.state.return_value = {
         "master_node" : "foo"
     }
     self.assertFalse(curator.is_master_node(client))
 def test_positive(self):
     client = Mock()
     client.nodes.info.return_value = {
         'nodes': { "foo" : "bar"}
     }
     client.cluster.state.return_value = {
         "master_node" : "foo"
     }
     self.assertTrue(curator.is_master_node(client))
Exemple #3
0
 def test_negative(self):
     client = Mock()
     client.nodes.info.return_value = {'nodes': {"bad": "mojo"}}
     client.cluster.state.return_value = {"master_node": "foo"}
     self.assertFalse(curator.is_master_node(client))
Exemple #4
0
 def test_positive(self):
     client = Mock()
     client.nodes.info.return_value = {'nodes': {"foo": "bar"}}
     client.cluster.state.return_value = {"master_node": "foo"}
     self.assertTrue(curator.is_master_node(client))