From 5cd5a05062ae3e010a2dc8424b5b1f78974783f9 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 17 Oct 2023 22:03:35 +0200 Subject: [PATCH] chore: Fix black fmt --- papis_extract/__init__.py | 11 ++++++----- papis_extract/exporter.py | 2 +- tests/test_annotation.py | 6 ++++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/papis_extract/__init__.py b/papis_extract/__init__.py index 686dcbb..31d720d 100644 --- a/papis_extract/__init__.py +++ b/papis_extract/__init__.py @@ -8,10 +8,7 @@ import papis.strings from papis.document import Document from papis_extract import extractor, exporter -from papis_extract.formatter import ( - Formatter, - formatters -) +from papis_extract.formatter import Formatter, formatters logger = papis.logging.get_logger(__name__) @@ -104,7 +101,11 @@ def run( annotated_docs = extractor.start(documents) if write: exporter.to_notes( - formatter=formatter, annotated_docs=annotated_docs, edit=edit, git=git, force=force + formatter=formatter, + annotated_docs=annotated_docs, + edit=edit, + git=git, + force=force, ) else: exporter.to_stdout(formatter=formatter, annotated_docs=annotated_docs) diff --git a/papis_extract/exporter.py b/papis_extract/exporter.py index af66b13..80adb8c 100644 --- a/papis_extract/exporter.py +++ b/papis_extract/exporter.py @@ -67,7 +67,7 @@ def _add_annots_to_note( :type formatted_annotations: list[str] :param git: Flag indicating whether to commit changes to git, defaults to False. :type git: bool, optional - :param force: Flag indicating whether to force adding annotations even if they + :param force: Flag indicating whether to force adding annotations even if they already exist, defaults to False. :type force: bool, optional """ diff --git a/tests/test_annotation.py b/tests/test_annotation.py index c14ee93..529a4c1 100644 --- a/tests/test_annotation.py +++ b/tests/test_annotation.py @@ -26,13 +26,14 @@ def test_formatting_replacements(fmt_string, expected): assert sut.format(fmt_string) == expected + @pytest.mark.parametrize( "fmt_string,expected", [ ("{{doc.title}}", "document-title"), ("{{doc.title}}-{{doc.author}}", "document-title-document-author"), ("{{quote}} ({{doc.author}})", "I am the text value (document-author)"), - ] + ], ) def test_formatting_document_access(fmt_string, expected): sut = Annotation( @@ -40,10 +41,11 @@ def test_formatting_document_access(fmt_string, expected): text="I am the text value", content="Whereas I represent the note", ) - doc = Document(data= {"title": "document-title", "author": "document-author"}) + doc = Document(data={"title": "document-title", "author": "document-author"}) assert sut.format(fmt_string, doc=doc) == expected + def test_colorname_matches_exact(): sut = Annotation("testfile", colors=(1.0, 0.0, 0.0), minimum_similarity_color=1.0) c_name = sut.colorname