Exemplo n.º 1
0
 def test_tap_installed(self):
     '''
     Tests if tap argument is already installed or not
     '''
     with patch('salt.modules.mac_brew._list_taps',
                MagicMock(return_value=TAPS_LIST)):
         self.assertTrue(mac_brew._tap('homebrew/science'))
Exemplo n.º 2
0
 def test_tap(self):
     '''
     Tests adding unofficial GitHub repos to the list of brew taps
     '''
     mock_failure = MagicMock(return_value={'retcode': 0})
     mock_user = MagicMock(return_value='foo')
     mock_cmd = MagicMock(return_value='')
     with patch.dict(mac_brew.__salt__, {'cmd.run_all': mock_failure,
                                     'file.get_user': mock_user,
                                     'cmd.run': mock_cmd}):
         self.assertTrue(mac_brew._tap('homebrew/test'))
Exemplo n.º 3
0
 def test_tap(self):
     '''
     Tests adding unofficial GitHub repos to the list of brew taps
     '''
     mock_failure = MagicMock(return_value={'retcode': 0})
     mock_user = MagicMock(return_value='foo')
     mock_cmd = MagicMock(return_value='')
     with patch.dict(mac_brew.__salt__, {'cmd.run_all': mock_failure,
                                     'file.get_user': mock_user,
                                     'cmd.run': mock_cmd}):
         self.assertTrue(mac_brew._tap('homebrew/test'))
Exemplo n.º 4
0
 def test_tap_failure(self):
     '''
     Tests if the tap installation failed
     '''
     mock_failure = MagicMock(return_value={'retcode': 1})
     mock_user = MagicMock(return_value='foo')
     mock_cmd = MagicMock(return_value='')
     with patch.dict(mac_brew.__salt__, {'cmd.run_all': mock_failure,
                                     'file.get_user': mock_user,
                                     'cmd.run': mock_cmd}):
         self.assertFalse(mac_brew._tap('homebrew/test'))
Exemplo n.º 5
0
 def test_tap_failure(self):
     '''
     Tests if the tap installation failed
     '''
     mock_failure = MagicMock(return_value={'stdout': '',
                                            'stderr': '',
                                            'retcode': 1})
     mock_user = MagicMock(return_value='foo')
     mock_cmd = MagicMock(return_value='')
     with patch.dict(mac_brew.__salt__, {'cmd.run_all': mock_failure,
                                     'file.get_user': mock_user,
                                     'cmd.run': mock_cmd}):
         self.assertFalse(mac_brew._tap('homebrew/test'))
Exemplo n.º 6
0
 def test_tap_installed(self):
     '''
     Tests if tap argument is already installed or not
     '''
     self.assertTrue(mac_brew._tap('homebrew/science'))
Exemplo n.º 7
0
 def test_tap_installed(self):
     '''
     Tests if tap argument is already installed or not
     '''
     self.assertTrue(mac_brew._tap('homebrew/science'))