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'})
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'})