Adding docstring to functions in storage.py

This commit is contained in:
TheNavigat
2016-01-29 19:25:39 +02:00
parent 834b811ca0
commit b2ff1ed20f
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -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)):
+1 -1
View File
@@ -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)