Exemplo n.º 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'})
Exemplo n.º 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'})