Doctest cleanup
This commit is contained in:
parent
47cf3fc7d8
commit
53b4fb69b3
@ -29,7 +29,7 @@ def get_files_by_suffix(suffix):
|
|||||||
"""Retrieve all include files from the program configuration directory.
|
"""Retrieve all include files from the program configuration directory.
|
||||||
|
|
||||||
>>> get_files_by_suffix('-include.conf') # doctest: +ELLIPSIS
|
>>> get_files_by_suffix('-include.conf') # doctest: +ELLIPSIS
|
||||||
...
|
<generator object ...>
|
||||||
|
|
||||||
:param suffix: the suffix to search for
|
:param suffix: the suffix to search for
|
||||||
:type suffix: str
|
:type suffix: str
|
||||||
@ -45,8 +45,8 @@ def merge_files(files):
|
|||||||
|
|
||||||
Any files included that do not exist send a warning to the log.
|
Any files included that do not exist send a warning to the log.
|
||||||
|
|
||||||
>>> merge_files() # doctest: +ELLIPSIS
|
>>> merge_files(get_files_by_suffix('')) # doctest: +ELLIPSIS
|
||||||
PosixPath(/tmp/...)
|
PosixPath('/tmp/...')
|
||||||
|
|
||||||
:param files: files including paths to read from
|
:param files: files including paths to read from
|
||||||
:type files: iterable of path-like objects
|
:type files: iterable of path-like objects
|
||||||
|
@ -44,9 +44,6 @@ class Hierarchy(PathLike):
|
|||||||
def __init__(self, dest):
|
def __init__(self, dest):
|
||||||
"""Default constructor for the Hierarchy class.
|
"""Default constructor for the Hierarchy class.
|
||||||
|
|
||||||
>>> Hierarchy('backup_dir').path
|
|
||||||
PosixPath('backup_dir')
|
|
||||||
|
|
||||||
:param dest: the root directory of the backup hierarchy
|
:param dest: the root directory of the backup hierarchy
|
||||||
:type dest: str or path-like object
|
:type dest: str or path-like object
|
||||||
"""
|
"""
|
||||||
@ -66,9 +63,6 @@ class Hierarchy(PathLike):
|
|||||||
def path(self):
|
def path(self):
|
||||||
"""Return the base directory of this hierarchy.
|
"""Return the base directory of this hierarchy.
|
||||||
|
|
||||||
>>> Hierarchy('backup').path
|
|
||||||
PosixPath('backup')
|
|
||||||
|
|
||||||
:rtype: path-like object
|
:rtype: path-like object
|
||||||
"""
|
"""
|
||||||
return self._path
|
return self._path
|
||||||
@ -77,9 +71,6 @@ class Hierarchy(PathLike):
|
|||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of this hierarchy.
|
"""Return the name of this hierarchy.
|
||||||
|
|
||||||
>>> Hierarchy('backup/data/snapshot-one').name
|
|
||||||
'snapshot-one'
|
|
||||||
|
|
||||||
:rtype: str
|
:rtype: str
|
||||||
"""
|
"""
|
||||||
return self._path.name
|
return self._path.name
|
||||||
@ -88,9 +79,6 @@ class Hierarchy(PathLike):
|
|||||||
def metadata_path(self):
|
def metadata_path(self):
|
||||||
"""Return the path of this hierarchy's metadata file.
|
"""Return the path of this hierarchy's metadata file.
|
||||||
|
|
||||||
>>> Hierarchy('backup').metadata_path
|
|
||||||
PosixPath('backup/.metadata')
|
|
||||||
|
|
||||||
:rtype: path-like object
|
:rtype: path-like object
|
||||||
"""
|
"""
|
||||||
return self._path / ".metadata"
|
return self._path / ".metadata"
|
||||||
|
@ -39,9 +39,6 @@ class Snapshot(Hierarchy):
|
|||||||
@property
|
@property
|
||||||
def pkg_dir(self):
|
def pkg_dir(self):
|
||||||
"""Retrieve the package manager backup directory of this snapshot.
|
"""Retrieve the package manager backup directory of this snapshot.
|
||||||
>>> s = Snapshot('backup/data/snapshot-new')
|
|
||||||
>>> s.pkg_dir
|
|
||||||
PosixPath('backup/data/snapshot-new/pkg')
|
|
||||||
|
|
||||||
:rtype: path-like object
|
:rtype: path-like object
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user