extract_odf_links: Make "not found" warning easier to parse.
e.g., you can just use `grep | cut -b N-`.
This commit is contained in:
parent
42442c401f
commit
72f144e1ff
3 changed files with 5 additions and 3 deletions
|
@ -173,7 +173,7 @@ def main(arglist: Optional[Sequence[str]]=None,
|
|||
elif path not in seen:
|
||||
seen.add(path)
|
||||
if not path.exists():
|
||||
logger.warning("path %s not found", path)
|
||||
logger.warning("link path not found: %s", path)
|
||||
print(path, end=args.delimiter, file=stdout)
|
||||
|
||||
returncode = 0
|
||||
|
|
2
setup.py
2
setup.py
|
@ -5,7 +5,7 @@ from setuptools import setup
|
|||
setup(
|
||||
name='conservancy_beancount',
|
||||
description="Plugin, library, and reports for reading Conservancy's books",
|
||||
version='1.9.2',
|
||||
version='1.9.3',
|
||||
author='Software Freedom Conservancy',
|
||||
author_email='info@sfconservancy.org',
|
||||
license='GNU AGPLv3+',
|
||||
|
|
|
@ -26,6 +26,7 @@ from . import testutil
|
|||
from conservancy_beancount.tools import extract_odf_links
|
||||
|
||||
SRC_PATH = testutil.test_path('repository/LinksReport.ods')
|
||||
BAD_PATH_S = str(testutil.test_path('repository/Projects/Bad Link.txt'))
|
||||
|
||||
INCLUDED_FILE_LINKS = {
|
||||
Path('/repository/Projects/project-data.yml'),
|
||||
|
@ -63,7 +64,8 @@ def test_extract_file_links(arglist, sep, caplog):
|
|||
assert caplog.records
|
||||
assert any(
|
||||
log.levelname == 'WARNING'
|
||||
and log.message.endswith('/Bad Link.txt not found')
|
||||
and log.message.startswith('link path not found: ')
|
||||
and log.message.endswith(BAD_PATH_S)
|
||||
for log in caplog.records
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue