mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 03:32:13 +02:00
Merge pull request #1059 from mrwacky42/add-tests
Add a test, skip a test
This commit is contained in:
@@ -130,10 +130,7 @@ binary for temporary key/certificate generation.""".replace("\n", "")
|
|||||||
if self.conf("test-mode"):
|
if self.conf("test-mode"):
|
||||||
logger.debug("Test mode. Executing the manual command: %s", command)
|
logger.debug("Test mode. Executing the manual command: %s", command)
|
||||||
# sh shipped with OS X does't support echo -n
|
# sh shipped with OS X does't support echo -n
|
||||||
if sys.platform == "darwin":
|
executable = "/bin/bash" if sys.platform == "darwin" else None
|
||||||
executable = "/bin/bash"
|
|
||||||
else:
|
|
||||||
executable = None
|
|
||||||
try:
|
try:
|
||||||
self._httpd = subprocess.Popen(
|
self._httpd = subprocess.Popen(
|
||||||
command,
|
command,
|
||||||
|
|||||||
@@ -98,6 +98,10 @@ class AlreadyListeningTest(unittest.TestCase):
|
|||||||
self.assertEqual(mock_get_utility.call_count, 1)
|
self.assertEqual(mock_get_utility.call_count, 1)
|
||||||
mock_process.assert_called_once_with(4420)
|
mock_process.assert_called_once_with(4420)
|
||||||
|
|
||||||
|
@mock.patch("letsencrypt.plugins.util.psutil.net_connections")
|
||||||
|
def test_access_denied_exception(self, mock_net):
|
||||||
|
mock_net.side_effect = psutil.AccessDenied("")
|
||||||
|
self.assertFalse(self._call(12345))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main() # pragma: no cover
|
unittest.main() # pragma: no cover
|
||||||
|
|||||||
Reference in New Issue
Block a user