예제 #1
0
파일: riak_test.py 프로젝트: lvg01/salt.old
 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}})
예제 #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}})
예제 #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
                 }
             })
예제 #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,
                 },
             },
         )