def test_tap_failure(self): ''' Tests if the tap installation failed ''' mock_failure = MagicMock(return_value=1) with patch.dict(brew.__salt__, {'cmd.retcode': mock_failure}): self.assertFalse(brew._tap('homebrew/test'))
def test_tap(self): ''' Tests adding unofficial Github repos to the list of brew taps ''' mock_success = MagicMock(return_value=0) with patch.dict(brew.__salt__, {'cmd.retcode': mock_success}): self.assertTrue(brew._tap('homebrew/test'))
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(brew.__salt__, {'cmd.run_all': mock_failure, 'file.get_user': mock_user, 'cmd.run': mock_cmd}): self.assertTrue(brew._tap('homebrew/test'))
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(brew.__salt__, {'cmd.run_all': mock_failure, 'file.get_user': mock_user, 'cmd.run': mock_cmd}): self.assertFalse(brew._tap('homebrew/test'))
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(brew.__salt__, {'cmd.run_all': mock_failure, 'file.get_user': mock_user, 'cmd.run': mock_cmd, 'cmd.retcode': mock_failure}): self.assertFalse(brew._tap('homebrew/test'))
def test_tap(self): ''' Tests adding unofficial Github repos to the list of brew taps ''' mock_success = MagicMock(return_value={'retcode': 0}) mock_user = MagicMock(return_value='foo') mock_cmd = MagicMock(return_value='') with patch.dict( brew.__salt__, { 'cmd.run_all': mock_success, 'file.get_user': mock_user, 'cmd.run': mock_cmd }): self.assertTrue(brew._tap('homebrew/test'))
def test_tap_installed(self): ''' Tests if tap argument is already installed or not ''' self.assertTrue(brew._tap('homebrew/science'))