Exemplo n.º 1
0
 def test_member_status(self):
     '''
     Test for Get cluster member status
     '''
     with patch.object(riak, '__execute_cmd', return_value={'stdout': 'A:a/B:b\nC:c/D:d'}):
         self.assertDictEqual(riak.member_status(),
                              {'membership': {},
                               'summary': {'A': 'a', 'C': 'c', 'B': 'b',
                                           'D': 'd', 'Exiting': 0, 'Down': 0,
                                           'Valid': 0, 'Leaving': 0,
                                           'Joining': 0}})
Exemplo n.º 2
0
 def test_member_status(self):
     '''
     Test for Get cluster member status
     '''
     with patch.dict(riak.__salt__,
                     {'cmd.run':
                      MagicMock(return_value='A:a/B:b\nC:c/D:d')}):
         self.assertDictEqual(riak.member_status(),
                              {'membership': {},
                               'summary': {'A': 'a', 'C': 'c', 'B': 'b',
                                           'D': 'd', 'Exiting': 0, 'Down': 0,
                                           'Valid': 0, 'Leaving': 0,
                                           'Joining': 0}})
Exemplo n.º 3
0
 def test_member_status(self):
     '''
     Test for Get cluster member status
     '''
     with patch.dict(
             riak.__salt__,
         {'cmd.run': MagicMock(return_value='A:a/B:b\nC:c/D:d')}):
         self.assertDictEqual(
             riak.member_status(), {
                 'membership': {},
                 'summary': {
                     'A': 'a',
                     'C': 'c',
                     'B': 'b',
                     'D': 'd',
                     'Exiting': 0,
                     'Down': 0,
                     'Valid': 0,
                     'Leaving': 0,
                     'Joining': 0
                 }
             })
Exemplo n.º 4
0
 def test_member_status(self):
     """
     Test for Get cluster member status
     """
     with patch.object(riak,
                       "__execute_cmd",
                       return_value={"stdout": "A:a/B:b\nC:c/D:d"}):
         self.assertDictEqual(
             riak.member_status(),
             {
                 "membership": {},
                 "summary": {
                     "A": "a",
                     "C": "c",
                     "B": "b",
                     "D": "d",
                     "Exiting": 0,
                     "Down": 0,
                     "Valid": 0,
                     "Leaving": 0,
                     "Joining": 0,
                 },
             },
         )