Example #1
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))
Example #2
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))
Example #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))
Example #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))