OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
certbot
/
plugins
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/25/2021 01:14:26 PM
rwxr-xr-x
📄
__init__.py
30 bytes
02/07/2019 09:20:29 PM
rw-r--r--
📁
__pycache__
-
05/25/2021 01:14:27 PM
rwxr-xr-x
📄
common.py
16.9 KB
02/07/2019 09:20:29 PM
rw-r--r--
📄
common_test.py
16.53 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
disco.py
9.92 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
disco_test.py
11.34 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
dns_common.py
11.7 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
dns_common_lexicon.py
5.39 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
dns_common_lexicon_test.py
651 bytes
02/07/2019 09:20:30 PM
rw-r--r--
📄
dns_common_test.py
8.25 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
dns_test_common.py
1.61 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
dns_test_common_lexicon.py
5.48 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
enhancements.py
5.58 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
enhancements_test.py
2.36 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
manual.py
10.6 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
manual_test.py
7.37 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
null.py
1.34 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
null_test.py
624 bytes
02/07/2019 09:20:30 PM
rw-r--r--
📄
selection.py
13.55 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
selection_test.py
7.76 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
standalone.py
11.36 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
standalone_test.py
9.26 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
storage.py
4.08 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
storage_test.py
5.37 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
util.py
1.7 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
util_test.py
1.61 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
webroot.py
11.9 KB
02/07/2019 09:20:30 PM
rw-r--r--
📄
webroot_test.py
11.95 KB
02/07/2019 09:20:30 PM
rw-r--r--
Editing: util_test.py
Close
"""Tests for certbot.plugins.util.""" import os import unittest import mock class GetPrefixTest(unittest.TestCase): """Tests for certbot.plugins.get_prefixes.""" def test_get_prefix(self): from certbot.plugins.util import get_prefixes self.assertEqual( get_prefixes('/a/b/c'), [os.path.normpath(path) for path in ['/a/b/c', '/a/b', '/a', '/']]) self.assertEqual(get_prefixes('/'), [os.path.normpath('/')]) self.assertEqual(get_prefixes('a'), ['a']) class PathSurgeryTest(unittest.TestCase): """Tests for certbot.plugins.path_surgery.""" @mock.patch("certbot.plugins.util.logger.debug") def test_path_surgery(self, mock_debug): from certbot.plugins.util import path_surgery all_path = {"PATH": "/usr/local/bin:/bin/:/usr/sbin/:/usr/local/sbin/"} with mock.patch.dict('os.environ', all_path): with mock.patch('certbot.util.exe_exists') as mock_exists: mock_exists.return_value = True self.assertEqual(path_surgery("eg"), True) self.assertEqual(mock_debug.call_count, 0) self.assertEqual(os.environ["PATH"], all_path["PATH"]) no_path = {"PATH": "/tmp/"} with mock.patch.dict('os.environ', no_path): path_surgery("thingy") self.assertEqual(mock_debug.call_count, 2) self.assertTrue("Failed to find" in mock_debug.call_args[0][0]) self.assertTrue("/usr/local/bin" in os.environ["PATH"]) self.assertTrue("/tmp" in os.environ["PATH"]) if __name__ == "__main__": unittest.main() # pragma: no cover