Example #1
0
 def test_list_taps(self):
     '''
     Tests the return of the list of taps
     '''
     mock_taps = MagicMock(return_value={'stdout': TAPS_STRING})
     mock_user = MagicMock(return_value='foo')
     mock_cmd = MagicMock(return_value='')
     with patch.dict(mac_brew.__salt__, {'file.get_user': mock_user,
                                     'cmd.run_all': mock_taps,
                                     'cmd.run': mock_cmd}):
         self.assertEqual(mac_brew._list_taps(), TAPS_LIST)
Example #2
0
 def test_list_taps(self):
     '''
     Tests the return of the list of taps
     '''
     mock_taps = MagicMock(return_value={'stdout': TAPS_STRING,
                                         'retcode': 0})
     mock_user = MagicMock(return_value='foo')
     mock_cmd = MagicMock(return_value='')
     with patch.dict(mac_brew.__salt__, {'file.get_user': mock_user,
                                     'cmd.run_all': mock_taps,
                                     'cmd.run': mock_cmd}):
         self.assertEqual(mac_brew._list_taps(), TAPS_LIST)