Example #1
0
 def test_uninstall_missing_package(self):
     '''
     Test if it returns False when package is not installed
     '''
     mock = MagicMock(return_value={'retcode': 0, 'stdout': '{}'})
     with patch.dict(bower.__salt__, {'cmd.run_all': mock}):
         self.assertFalse(bower.uninstall('/path/to/project', 'underscore'))
Example #2
0
 def test_uninstall_missing_package(self):
     """
     Test if it returns False when package is not installed
     """
     mock = MagicMock(return_value={"retcode": 0, "stdout": "{}"})
     with patch.dict(bower.__salt__, {"cmd.run_all": mock}):
         self.assertFalse(bower.uninstall("/path/to/project", "underscore"))
Example #3
0
 def test_uninstall_existing_package(self):
     '''
     Test if it returns True when uninstall package succeeds
     '''
     mock = MagicMock(return_value={'retcode': 0,
                                    'stdout': '{"underscore": {}}'})
     with patch.dict(bower.__salt__, {'cmd.run_all': mock}):
         self.assertTrue(bower.uninstall('/path/to/project', 'underscore'))
Example #4
0
 def test_uninstall_missing_package(self):
     '''
     Test if it returns False when package is not installed
     '''
     mock = MagicMock(return_value={'retcode': 0,
                                    'stdout': '{}'})
     with patch.dict(bower.__salt__, {'cmd.run_all': mock}):
         self.assertFalse(bower.uninstall('/path/to/project', 'underscore'))
Example #5
0
 def test_uninstall_existing_package(self):
     '''
     Test if it returns True when uninstall package succeeds
     '''
     mock = MagicMock(return_value={'retcode': 0,
                                    'stdout': '{"underscore": {}}'})
     with patch.dict(bower.__salt__, {'cmd.run_all': mock}):
         self.assertTrue(bower.uninstall('/path/to/project', 'underscore'))
Example #6
0
 def test_uninstall_existing_package(self):
     """
     Test if it returns True when uninstall package succeeds
     """
     mock = MagicMock(return_value={
         "retcode": 0,
         "stdout": '{"underscore": {}}'
     })
     with patch.dict(bower.__salt__, {"cmd.run_all": mock}):
         self.assertTrue(bower.uninstall("/path/to/project", "underscore"))