示例#1
0
文件: bower_test.py 项目: DaveQB/salt
 def test_install_new_package(self):
     '''
     Test if it returns True when install package succeeds
     '''
     mock = MagicMock(return_value={'retcode': 0,
                                    'stdout': '{"underscore":{}}'})
     with patch.dict(bower.__salt__, {'cmd.run_all': mock}):
         self.assertTrue(bower.install('/path/to/project', 'underscore'))
示例#2
0
文件: bower_test.py 项目: DaveQB/salt
 def test_install_existing_package(self):
     '''
     Test if it returns False when package already installed
     '''
     mock = MagicMock(return_value={'retcode': 0,
                                    'stdout': '{}'})
     with patch.dict(bower.__salt__, {'cmd.run_all': mock}):
         self.assertFalse(bower.install('/path/to/project', 'underscore'))
示例#3
0
文件: test_bower.py 项目: vindir/salt
 def test_install_new_package(self):
     '''
     Test if it returns True when install package succeeds
     '''
     mock = MagicMock(return_value={
         'retcode': 0,
         'stdout': '{"underscore":{}}'
     })
     with patch.dict(bower.__salt__, {'cmd.run_all': mock}):
         self.assertTrue(bower.install('/path/to/project', 'underscore'))
示例#4
0
 def test_install_new_package(self):
     """
     Test if it returns True when install package succeeds
     """
     mock = MagicMock(return_value={
         "retcode": 0,
         "stdout": '{"underscore":{}}'
     })
     with patch.dict(bower.__salt__, {"cmd.run_all": mock}):
         self.assertTrue(bower.install("/path/to/project", "underscore"))