Merge pull request #1059 from mrwacky42/add-tests

Add  a test, skip a test
This commit is contained in:
Peter Eckersley 2015-10-21 09:51:04 -07:00
commit 3ea810d404
2 changed files with 5 additions and 4 deletions

View file

@ -130,10 +130,7 @@ binary for temporary key/certificate generation.""".replace("\n", "")
if self.conf("test-mode"):
logger.debug("Test mode. Executing the manual command: %s", command)
# sh shipped with OS X does't support echo -n
if sys.platform == "darwin":
executable = "/bin/bash"
else:
executable = None
executable = "/bin/bash" if sys.platform == "darwin" else None
try:
self._httpd = subprocess.Popen(
command,

View file

@ -98,6 +98,10 @@ class AlreadyListeningTest(unittest.TestCase):
self.assertEqual(mock_get_utility.call_count, 1)
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__":
unittest.main() # pragma: no cover