"""Tests for certbot.compat.""" import os from certbot import compat import certbot.tests.util as test_util class OsReplaceTest(test_util.TempDirTestCase): """Test to ensure consistent behavior of os_rename method""" def test_os_rename_to_existing_file(self): """Ensure that os_rename will effectively rename src into dst for all platforms.""" src = os.path.join(self.tempdir, 'src') dst = os.path.join(self.tempdir, 'dst') open(src, 'w').close() open(dst, 'w').close() # On Windows, a direct call to os.rename will fail because dst already exists. compat.os_rename(src, dst) self.assertFalse(os.path.exists(src)) self.assertTrue(os.path.exists(dst))
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
display | Folder | 0755 |
|
|
testdata | Folder | 0755 |
|
|
__init__.py | File | 20 B | 0644 |
|
account_test.py | File | 14.45 KB | 0644 |
|
acme_util.py | File | 3.18 KB | 0644 |
|
auth_handler_test.py | File | 24 KB | 0644 |
|
cert_manager_test.py | File | 28.07 KB | 0644 |
|
cli_test.py | File | 19.94 KB | 0644 |
|
client_test.py | File | 28.76 KB | 0644 |
|
compat_test.py | File | 736 B | 0644 |
|
configuration_test.py | File | 6.82 KB | 0644 |
|
crypto_util_test.py | File | 13.56 KB | 0644 |
|
eff_test.py | File | 5.94 KB | 0644 |
|
error_handler_test.py | File | 5.31 KB | 0644 |
|
errors_test.py | File | 1.8 KB | 0644 |
|
hook_test.py | File | 16.67 KB | 0644 |
|
lock_test.py | File | 3.84 KB | 0644 |
|
log_test.py | File | 14.95 KB | 0644 |
|
main_test.py | File | 82.52 KB | 0644 |
|
notify_test.py | File | 2.07 KB | 0644 |
|
ocsp_test.py | File | 6.27 KB | 0644 |
|
renewal_test.py | File | 4.18 KB | 0644 |
|
renewupdater_test.py | File | 5.32 KB | 0644 |
|
reporter_test.py | File | 2.73 KB | 0644 |
|
reverter_test.py | File | 18.7 KB | 0644 |
|
storage_test.py | File | 42.89 KB | 0644 |
|
util.py | File | 14.12 KB | 0644 |
|
util_test.py | File | 21.58 KB | 0644 |
|