mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:05:31 +02:00
Adding docstring to functions in storage.py
This commit is contained in:
@@ -131,7 +131,9 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes
|
||||
self._check_symlinks()
|
||||
|
||||
def _check_symlinks(self):
|
||||
"""Raises an exception if a symlink doesn't exist"""
|
||||
def check(link):
|
||||
"""Checks if symlink points to a file that exists"""
|
||||
return os.path.exists(os.path.realpath(link))
|
||||
for kind in ALL_FOUR:
|
||||
if not check(getattr(self, kind)):
|
||||
|
||||
@@ -76,7 +76,7 @@ class BaseRenewableCertTest(unittest.TestCase):
|
||||
junk.close()
|
||||
|
||||
self.defaults = configobj.ConfigObj()
|
||||
|
||||
|
||||
with mock.patch("letsencrypt.storage.RenewableCert._check_symlinks") as check:
|
||||
check.return_value = True
|
||||
self.test_rc = storage.RenewableCert(config.filename, self.cli_config)
|
||||
|
||||
Reference in New Issue
Block a user