Changeset - 72f144e1fffb
[Not reviewed]
0 3 0
Brett Smith - 4 years ago 2020-09-03 13:45:31
brettcsmith@brettcsmith.org
extract_odf_links: Make "not found" warning easier to parse.

e.g., you can just use `grep | cut -b N-`.
3 files changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/tools/extract_odf_links.py
Show inline comments
...
 
@@ -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
setup.py
Show inline comments
...
 
@@ -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+',
tests/test_extract_odf_links.py
Show inline comments
...
 
@@ -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
 
    )
 

	
0 comments (0 inline, 0 general)