Linux anchor 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
Apache/2.4.18 (Ubuntu)
Server IP : 10.10.100.4 & Your IP : 216.73.216.195
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
certbot /
tests /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2021-02-25 12:38
display
[ DIR ]
drwxr-xr-x
2021-02-25 12:38
testdata
[ DIR ]
drwxr-xr-x
2021-02-25 12:37
__init__.py
20
B
-rw-r--r--
2019-02-07 22:20
account_test.py
14.45
KB
-rw-r--r--
2019-02-07 22:20
acme_util.py
3.18
KB
-rw-r--r--
2019-02-07 22:20
auth_handler_test.py
24
KB
-rw-r--r--
2019-02-07 22:20
cert_manager_test.py
28.07
KB
-rw-r--r--
2019-02-07 22:20
cli_test.py
19.94
KB
-rw-r--r--
2019-02-07 22:20
client_test.py
28.76
KB
-rw-r--r--
2019-02-07 22:20
compat_test.py
736
B
-rw-r--r--
2019-02-07 22:20
configuration_test.py
6.82
KB
-rw-r--r--
2019-02-07 22:20
crypto_util_test.py
13.56
KB
-rw-r--r--
2019-02-07 22:20
eff_test.py
5.94
KB
-rw-r--r--
2019-02-07 22:20
error_handler_test.py
5.31
KB
-rw-r--r--
2019-02-07 22:20
errors_test.py
1.8
KB
-rw-r--r--
2019-02-07 22:20
hook_test.py
16.67
KB
-rw-r--r--
2019-02-07 22:20
lock_test.py
3.84
KB
-rw-r--r--
2019-02-07 22:20
log_test.py
14.95
KB
-rw-r--r--
2019-02-07 22:20
main_test.py
82.52
KB
-rw-r--r--
2019-02-07 22:20
notify_test.py
2.07
KB
-rw-r--r--
2019-02-07 22:20
ocsp_test.py
6.27
KB
-rw-r--r--
2019-02-07 22:20
renewal_test.py
4.18
KB
-rw-r--r--
2020-12-18 22:20
renewupdater_test.py
5.32
KB
-rw-r--r--
2019-02-07 22:20
reporter_test.py
2.73
KB
-rw-r--r--
2019-02-07 22:20
reverter_test.py
18.7
KB
-rw-r--r--
2019-02-07 22:20
storage_test.py
42.89
KB
-rw-r--r--
2019-02-07 22:20
util.py
14.12
KB
-rw-r--r--
2019-02-07 22:20
util_test.py
21.58
KB
-rw-r--r--
2019-02-07 22:20
Save
Rename
"""Tests for certbot.notify.""" import socket import unittest import mock class NotifyTests(unittest.TestCase): """Tests for the notifier.""" @mock.patch("certbot.notify.smtplib.LMTP") def test_smtp_success(self, mock_lmtp): from certbot.notify import notify lmtp_obj = mock.MagicMock() mock_lmtp.return_value = lmtp_obj self.assertTrue(notify("Goose", "auntrhody@example.com", "The old grey goose is dead.")) self.assertEqual(lmtp_obj.connect.call_count, 1) self.assertEqual(lmtp_obj.sendmail.call_count, 1) @mock.patch("certbot.notify.smtplib.LMTP") @mock.patch("certbot.notify.subprocess.Popen") def test_smtp_failure(self, mock_popen, mock_lmtp): from certbot.notify import notify lmtp_obj = mock.MagicMock() mock_lmtp.return_value = lmtp_obj lmtp_obj.sendmail.side_effect = socket.error(17) proc = mock.MagicMock() mock_popen.return_value = proc self.assertTrue(notify("Goose", "auntrhody@example.com", "The old grey goose is dead.")) self.assertEqual(lmtp_obj.sendmail.call_count, 1) self.assertEqual(proc.communicate.call_count, 1) @mock.patch("certbot.notify.smtplib.LMTP") @mock.patch("certbot.notify.subprocess.Popen") def test_everything_fails(self, mock_popen, mock_lmtp): from certbot.notify import notify lmtp_obj = mock.MagicMock() mock_lmtp.return_value = lmtp_obj lmtp_obj.sendmail.side_effect = socket.error(17) proc = mock.MagicMock() mock_popen.return_value = proc proc.communicate.side_effect = OSError("What we have here is a " "failure to communicate.") self.assertFalse(notify("Goose", "auntrhody@example.com", "The old grey goose is dead.")) self.assertEqual(lmtp_obj.sendmail.call_count, 1) self.assertEqual(proc.communicate.call_count, 1) if __name__ == "__main__": unittest.main() # pragma: no cover