示例#1
0
 def test_useradd(self):
     '''
     Test if it adds an HTTP user using the htpasswd command
     '''
     mock = MagicMock(return_value={'out': 'Salt'})
     with patch.dict(htpasswd.__salt__, {'cmd.run_all': mock}):
         self.assertDictEqual(
             htpasswd.useradd('/etc/httpd/htpasswd', 'larry',
                              'badpassword'), {'out': 'Salt'})
示例#2
0
 def test_useradd(self):
     '''
     Test if it adds an HTTP user using the htpasswd command
     '''
     mock = MagicMock(return_value={'out': 'Salt'})
     with patch.dict(htpasswd.__salt__, {'cmd.run_all': mock}):
         self.assertDictEqual(htpasswd.useradd('/etc/httpd/htpasswd',
                                               'larry', 'badpassword'),
                              {'out': 'Salt'})