From 2099e993a79d8d9beeb5e17effdba464b12327c7 Mon Sep 17 00:00:00 2001 From: luis guilherme Date: Thu, 20 Jun 2024 17:51:39 -0300 Subject: [PATCH 01/19] add header_text in schema validate --- schemas/ro-dou.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schemas/ro-dou.json b/schemas/ro-dou.json index bc8f428..5ba4338 100644 --- a/schemas/ro-dou.json +++ b/schemas/ro-dou.json @@ -224,6 +224,10 @@ "hide_filters": { "type": "boolean", "description": "description" + }, + "header_text": { + "type": "string", + "description": "description" } }, "additionalProperties": false From b27e8685a875331c0186d8b5eb883159b8de380d Mon Sep 17 00:00:00 2001 From: luis guilherme Date: Thu, 20 Jun 2024 17:53:01 -0300 Subject: [PATCH 02/19] add block for header_text --- src/notification/email_sender.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/notification/email_sender.py b/src/notification/email_sender.py index dee7c5c..a6dc4d2 100644 --- a/src/notification/email_sender.py +++ b/src/notification/email_sender.py @@ -70,6 +70,9 @@ def generate_email_content(self) -> str: with open(file_path, "r") as f: blocks = [f""] + if self.specs.header_text: + blocks.append(self.specs.header_text) + for search in self.search_report: if search["header"]: From 9625ec8ba83473ed8538b543908e58710dec2c94 Mon Sep 17 00:00:00 2001 From: luis guilherme Date: Thu, 20 Jun 2024 17:54:12 -0300 Subject: [PATCH 03/19] add header_text in parse --- src/parsers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parsers.py b/src/parsers.py index 029d610..d8e0edb 100644 --- a/src/parsers.py +++ b/src/parsers.py @@ -45,6 +45,7 @@ class DAGConfig: dag_tags: Set[str] owner: str hide_filters: bool + header_text: str class FileParser(ABC): @@ -154,6 +155,7 @@ def _parse_yaml(self) -> DAGConfig: subject = report.get("subject", "Extraçao do DOU") attach_csv = report.get("attach_csv", False) hide_filters = report.get("hide_filters", False) + header_text = report.get("header_text", None) return DAGConfig( dag_id=dag_id, @@ -169,7 +171,8 @@ def _parse_yaml(self) -> DAGConfig: doc_md=doc_md, dag_tags=set(dag_tags), owner=owner, - hide_filters=hide_filters + hide_filters=hide_filters, + header_text=header_text ) def _get_terms_params(self, search) -> Tuple[List[str], str, str]: From 98455b842f4b4baadce646d3ce729230ccb130ce Mon Sep 17 00:00:00 2001 From: luis guilherme Date: Thu, 20 Jun 2024 17:55:47 -0300 Subject: [PATCH 04/19] add test for header_and_footer_example --- tests/parsers_test.py | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/parsers_test.py b/tests/parsers_test.py index 50275f4..45ad84d 100644 --- a/tests/parsers_test.py +++ b/tests/parsers_test.py @@ -69,6 +69,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "dag_tags": {"dou", "generated_dag"}, "owner": "", "hide_filters": False, + "header_text": None, }, ), ( @@ -109,6 +110,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "dag_tags": {"dou", "generated_dag", "projeto_a", "departamento_x"}, "owner": "pessoa 1, pessoa 2", "hide_filters": False, + "header_text": None, }, ), ( @@ -152,6 +154,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "dag_tags": {"dou", "generated_dag"}, "owner": "", "hide_filters": False, + "header_text": None, }, ), ( @@ -188,6 +191,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "dag_tags": {"dou", "generated_dag"}, "owner": "", "hide_filters": False, + "header_text": None, }, ), ( @@ -236,6 +240,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "dag_tags": {"dou", "generated_dag"}, "owner": "", "hide_filters": False, + "header_text": None, }, ), ( @@ -275,6 +280,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "dag_tags": {"dou", "generated_dag"}, "owner": "", "hide_filters": False, + "header_text": None, }, ), ( @@ -311,6 +317,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "dag_tags": {"dou", "generated_dag", "inlabs"}, "owner": "cdata", "hide_filters": False, + "header_text": None, }, ), ( @@ -350,6 +357,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "dag_tags": {"dou", "generated_dag", "inlabs"}, "owner": "cdata", "hide_filters": False, + "header_text": None, }, ), ( @@ -410,6 +418,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "dag_tags": {"dou", "generated_dag", "inlabs"}, "owner": "", "hide_filters": False, + "header_text": None, }, ), ( @@ -449,10 +458,52 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "dag_tags": {"dou", "inlabs", "generated_dag"}, "owner": "", "hide_filters": True, + "header_text": None, + }, + ), + ( + "header_and_footer_example.yaml", + { + "dag_id": "header_and_footer_example", + "search": [ + { + "terms": ["tecnologia", "informação"], + "header": None, + "sources": ["INLABS"], + "sql": None, + "conn_id": None, + "territory_id": None, + "dou_sections": ["TODOS"], + "search_date": "DIA", + "field": "TUDO", + "is_exact_search": True, + "ignore_signature_match": False, + "force_rematch": None, + "full_text": None, + "department": [ + "Ministério da Gestão e da Inovação em Serviços Públicos", + "Ministério da Defesa", + ], + } + ], + "emails": ["destination@economia.gov.br"], + "subject": "Teste do Ro-dou", + "attach_csv": False, + "discord_webhook": None, + "slack_webhook": None, + "schedule": "0 8 * * MON-FRI", + "description": "DAG de teste", + "skip_null": True, + "doc_md": None, + "dag_tags": {"dou", "inlabs", "generated_dag"}, + "owner": "", + "hide_filters": False, + "header_text": "

Greetings

" }, ), ], ) + def test_parse(filepath, result_tuple): filepath = os.path.join( DouDigestDagGenerator().YAMLS_DIR, "examples_and_tests", filepath From 73493ed02b2f8dee5d5df331020033d6d71e55c4 Mon Sep 17 00:00:00 2001 From: luis guilherme Date: Thu, 20 Jun 2024 17:57:14 -0300 Subject: [PATCH 05/19] create example for header_and_footer --- .../header_and_footer_example.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 dag_confs/examples_and_tests/header_and_footer_example.yaml diff --git a/dag_confs/examples_and_tests/header_and_footer_example.yaml b/dag_confs/examples_and_tests/header_and_footer_example.yaml new file mode 100644 index 0000000..32de25b --- /dev/null +++ b/dag_confs/examples_and_tests/header_and_footer_example.yaml @@ -0,0 +1,21 @@ +dag: + id: header_and_footer_example + description: DAG de teste + tags: + - inlabs + schedule: 0 8 * * MON-FRI + search: + sources: + - INLABS + terms: + - tecnologia + - informação + department: + - Ministério da Gestão e da Inovação em Serviços Públicos + - Ministério da Defesa + report: + emails: + - destination@economia.gov.br + subject: "Teste do Ro-dou" + header_text: | +

Greetings

\ No newline at end of file From d0b5b35e888f56cc7de4d3a882fb0cd7a7c70eaf Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 09:36:50 -0300 Subject: [PATCH 06/19] add header_text in discord template --- src/notification/discord_sender.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/notification/discord_sender.py b/src/notification/discord_sender.py index cf10137..417d604 100644 --- a/src/notification/discord_sender.py +++ b/src/notification/discord_sender.py @@ -1,5 +1,5 @@ import requests - +import re from notification.isender import ISender @@ -9,9 +9,14 @@ class DiscordSender(ISender): def __init__(self, specs) -> None: self.webhook_url = specs.discord_webhook self.hide_filters = specs.hide_filters + self.header_text = specs.header_text def send(self, search_report: list, report_date: str = None): """Parse the content, and send message to Discord""" + if self.header_text: + header_text = self._remove_html_tags(self.header_text) + self.send_text(header_text) + for search in search_report: if search["header"]: self.send_text(f'**{search["header"]}**') @@ -52,3 +57,9 @@ def send_data(self, data): data["username"] = "Querido Prisma (rodou)" result = requests.post(self.webhook_url, json=data) result.raise_for_status() + + def _remove_html_tags(self, text): + # Define a regular expression pattern to match HTML tags + clean = re.compile('<.*?>') + # Substitute HTML tags with an empty string + return re.sub(clean, '', text) \ No newline at end of file From 55bac29540dac20e4446ceb90628fd1f6d8f1447 Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 09:37:08 -0300 Subject: [PATCH 07/19] add header_text in slack template --- src/notification/slack_sender.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/notification/slack_sender.py b/src/notification/slack_sender.py index 9395172..34bb374 100644 --- a/src/notification/slack_sender.py +++ b/src/notification/slack_sender.py @@ -1,7 +1,7 @@ from datetime import datetime import requests - +import re from notification.isender import ISender @@ -12,9 +12,14 @@ def __init__(self, specs) -> None: self.webhook_url = specs.slack_webhook self.blocks = [] self.hide_filters = specs.hide_filters + self.header_text = specs.header_text def send(self, search_report: list, report_date: str = None): """Parse the content, and send message to Slack""" + if self.header_text: + header_text = _remove_html_tags(self.header_text) + self._add_header(header_text) + for search in search_report: if search["header"]: self._add_header(search["header"]) @@ -99,3 +104,9 @@ def _format_date(date_str: str) -> str: date = datetime.strptime(date_str, "%d/%m/%Y") _from, _to = WEEKDAYS_EN_TO_PT[date.weekday()] return date.strftime("%a %d/%m").replace(_from, _to) + +def _remove_html_tags(text): + # Define a regular expression pattern to match HTML tags + clean = re.compile('<.*?>') + # Substitute HTML tags with an empty string + return re.sub(clean, '', text) \ No newline at end of file From dd00700b005ef554e3cd28a74cf5d863d42ce6b0 Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 09:37:25 -0300 Subject: [PATCH 08/19] fix test for discord_sender --- tests/discord_sender_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/discord_sender_test.py b/tests/discord_sender_test.py index d1d9d65..2257914 100644 --- a/tests/discord_sender_test.py +++ b/tests/discord_sender_test.py @@ -8,8 +8,8 @@ @pytest.fixture def mocked_specs(): - Specs = namedtuple('Specs', ['discord_webhook', 'hide_filters']) - return Specs(WEBHOOK, False) + Specs = namedtuple('Specs', ['discord_webhook', 'hide_filters', 'header_text']) + return Specs(WEBHOOK, False, None) def test_send_discord_data(session_mocker: MockerFixture, mocked_specs): session_mocker.patch( From d892c3245995e0be47f6e064a0ce395e28e4ee5c Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 09:47:44 -0300 Subject: [PATCH 09/19] change source to dou from example --- .../examples_and_tests/header_and_footer_example.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dag_confs/examples_and_tests/header_and_footer_example.yaml b/dag_confs/examples_and_tests/header_and_footer_example.yaml index 32de25b..52efead 100644 --- a/dag_confs/examples_and_tests/header_and_footer_example.yaml +++ b/dag_confs/examples_and_tests/header_and_footer_example.yaml @@ -2,7 +2,7 @@ dag: id: header_and_footer_example description: DAG de teste tags: - - inlabs + - dou schedule: 0 8 * * MON-FRI search: sources: @@ -17,5 +17,6 @@ dag: emails: - destination@economia.gov.br subject: "Teste do Ro-dou" - header_text: | -

Greetings

\ No newline at end of file + header_text: | +

Greetings

+ From 3311f4430212a74448c36d26de345481b73b58f2 Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 09:58:56 -0300 Subject: [PATCH 10/19] change source to DOU --- dag_confs/examples_and_tests/header_and_footer_example.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dag_confs/examples_and_tests/header_and_footer_example.yaml b/dag_confs/examples_and_tests/header_and_footer_example.yaml index 52efead..bc90491 100644 --- a/dag_confs/examples_and_tests/header_and_footer_example.yaml +++ b/dag_confs/examples_and_tests/header_and_footer_example.yaml @@ -6,7 +6,7 @@ dag: schedule: 0 8 * * MON-FRI search: sources: - - INLABS + - DOU terms: - tecnologia - informação @@ -18,5 +18,4 @@ dag: - destination@economia.gov.br subject: "Teste do Ro-dou" header_text: | -

Greetings

- +

Greetings

\ No newline at end of file From 95482dfa2c2ec76edca8ca396ce7daad30e91b35 Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 09:59:16 -0300 Subject: [PATCH 11/19] fix parser for header_and_footer_example.yaml --- tests/parsers_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parsers_test.py b/tests/parsers_test.py index 45ad84d..ca93dda 100644 --- a/tests/parsers_test.py +++ b/tests/parsers_test.py @@ -469,7 +469,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): { "terms": ["tecnologia", "informação"], "header": None, - "sources": ["INLABS"], + "sources": ["DOU"], "sql": None, "conn_id": None, "territory_id": None, @@ -495,7 +495,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "description": "DAG de teste", "skip_null": True, "doc_md": None, - "dag_tags": {"dou", "inlabs", "generated_dag"}, + "dag_tags": {"dou", "generated_dag"}, "owner": "", "hide_filters": False, "header_text": "

Greetings

" From 56d61a0fbffb48e4075d054c88b71a198bda35e7 Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 11:56:19 -0300 Subject: [PATCH 12/19] add footer_text in example --- dag_confs/examples_and_tests/header_and_footer_example.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dag_confs/examples_and_tests/header_and_footer_example.yaml b/dag_confs/examples_and_tests/header_and_footer_example.yaml index bc90491..225e16c 100644 --- a/dag_confs/examples_and_tests/header_and_footer_example.yaml +++ b/dag_confs/examples_and_tests/header_and_footer_example.yaml @@ -17,5 +17,5 @@ dag: emails: - destination@economia.gov.br subject: "Teste do Ro-dou" - header_text: | -

Greetings

\ No newline at end of file + header_text:

Greetings

+ footer_text:

Best Regards

\ No newline at end of file From 5bf2ca0d1bc7a49bfe09dc6d67c8bab5479722cc Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 11:56:31 -0300 Subject: [PATCH 13/19] add footer_text in schema --- schemas/ro-dou.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schemas/ro-dou.json b/schemas/ro-dou.json index 5ba4338..dc4269c 100644 --- a/schemas/ro-dou.json +++ b/schemas/ro-dou.json @@ -228,6 +228,10 @@ "header_text": { "type": "string", "description": "description" + }, + "footer_text": { + "type": "string", + "description": "description" } }, "additionalProperties": false From 6e3a40987669c86228458cd59adf448c478a6252 Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 11:57:00 -0300 Subject: [PATCH 14/19] add footer_text in email template --- src/notification/email_sender.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/notification/email_sender.py b/src/notification/email_sender.py index a6dc4d2..7233c5a 100644 --- a/src/notification/email_sender.py +++ b/src/notification/email_sender.py @@ -124,6 +124,8 @@ def generate_email_content(self) -> str: blocks.append(textwrap.dedent(item_html)) blocks.append("---") + if self.specs.footer_text: + blocks.append(self.specs.footer_text) return markdown.markdown("\n".join(blocks)) From 188578d4a5c7aafed5b5b4b1636ecdb7ab5adb07 Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 11:57:24 -0300 Subject: [PATCH 15/19] add footer_text in parsers --- src/parsers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parsers.py b/src/parsers.py index d8e0edb..95b84f9 100644 --- a/src/parsers.py +++ b/src/parsers.py @@ -46,6 +46,7 @@ class DAGConfig: owner: str hide_filters: bool header_text: str + footer_text: str class FileParser(ABC): @@ -156,6 +157,7 @@ def _parse_yaml(self) -> DAGConfig: attach_csv = report.get("attach_csv", False) hide_filters = report.get("hide_filters", False) header_text = report.get("header_text", None) + footer_text = report.get("footer_text", None) return DAGConfig( dag_id=dag_id, @@ -172,7 +174,8 @@ def _parse_yaml(self) -> DAGConfig: dag_tags=set(dag_tags), owner=owner, hide_filters=hide_filters, - header_text=header_text + header_text=header_text, + footer_text=footer_text ) def _get_terms_params(self, search) -> Tuple[List[str], str, str]: From fff4eaae261f8efcc373dfe81abdfa4fce94b73c Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 11:57:47 -0300 Subject: [PATCH 16/19] adjust tests for parsing --- tests/parsers_test.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/parsers_test.py b/tests/parsers_test.py index ca93dda..967181d 100644 --- a/tests/parsers_test.py +++ b/tests/parsers_test.py @@ -70,6 +70,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "owner": "", "hide_filters": False, "header_text": None, + "footer_text": None, }, ), ( @@ -111,6 +112,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "owner": "pessoa 1, pessoa 2", "hide_filters": False, "header_text": None, + "footer_text": None, }, ), ( @@ -155,6 +157,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "owner": "", "hide_filters": False, "header_text": None, + "footer_text": None, }, ), ( @@ -192,6 +195,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "owner": "", "hide_filters": False, "header_text": None, + "footer_text": None, }, ), ( @@ -241,6 +245,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "owner": "", "hide_filters": False, "header_text": None, + "footer_text": None, }, ), ( @@ -281,6 +286,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "owner": "", "hide_filters": False, "header_text": None, + "footer_text": None, }, ), ( @@ -318,6 +324,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "owner": "cdata", "hide_filters": False, "header_text": None, + "footer_text": None, }, ), ( @@ -358,6 +365,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "owner": "cdata", "hide_filters": False, "header_text": None, + "footer_text": None, }, ), ( @@ -419,6 +427,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "owner": "", "hide_filters": False, "header_text": None, + "footer_text": None, }, ), ( @@ -459,6 +468,7 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "owner": "", "hide_filters": True, "header_text": None, + "footer_text": None, }, ), ( @@ -498,7 +508,8 @@ def test_hash_dag_id(yaml_parser, dag_id, size, hashed): "dag_tags": {"dou", "generated_dag"}, "owner": "", "hide_filters": False, - "header_text": "

Greetings

" + "header_text": "

Greetings

", + "footer_text": "

Best Regards

", }, ), ], From 668e73a4bc1337d224a255c5a45cfc4491bf2ad1 Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 12:05:58 -0300 Subject: [PATCH 17/19] add footer_text in discord template --- src/notification/discord_sender.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/notification/discord_sender.py b/src/notification/discord_sender.py index 417d604..d612047 100644 --- a/src/notification/discord_sender.py +++ b/src/notification/discord_sender.py @@ -10,6 +10,7 @@ def __init__(self, specs) -> None: self.webhook_url = specs.discord_webhook self.hide_filters = specs.hide_filters self.header_text = specs.header_text + self.footer_text = specs.footer_text def send(self, search_report: list, report_date: str = None): """Parse the content, and send message to Discord""" @@ -36,6 +37,10 @@ def send(self, search_report: list, report_date: str = None): "**Nenhum dos termos pesquisados foi encontrado nesta consulta**" ) + if self.footer_text: + footer_text = self._remove_html_tags(self.footer_text) + self.send_text(footer_text) + def send_text(self, content): self.send_data({"content": content}) From e13f2d63325b36d2e3e2d5a2a00f083858890f49 Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 12:06:10 -0300 Subject: [PATCH 18/19] add footer_text in slack template --- src/notification/slack_sender.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/notification/slack_sender.py b/src/notification/slack_sender.py index 34bb374..fb5d933 100644 --- a/src/notification/slack_sender.py +++ b/src/notification/slack_sender.py @@ -13,6 +13,7 @@ def __init__(self, specs) -> None: self.blocks = [] self.hide_filters = specs.hide_filters self.header_text = specs.header_text + self.footer_text = specs.footer_text def send(self, search_report: list, report_date: str = None): """Parse the content, and send message to Slack""" @@ -38,6 +39,10 @@ def send(self, search_report: list, report_date: str = None): self._add_text( "Nenhum dos termos pesquisados foi encontrado nesta consulta." ) + + if self.footer_text: + footer_text = _remove_html_tags(self.footer_text) + self._add_header(footer_text) self._flush() def _add_header(self, text): From 737eb210db1e4e3bc20488d844c10459e18867e6 Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Fri, 21 Jun 2024 12:06:28 -0300 Subject: [PATCH 19/19] fix specs mocks for discord tests --- tests/discord_sender_test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/discord_sender_test.py b/tests/discord_sender_test.py index 2257914..30ab741 100644 --- a/tests/discord_sender_test.py +++ b/tests/discord_sender_test.py @@ -8,8 +8,12 @@ @pytest.fixture def mocked_specs(): - Specs = namedtuple('Specs', ['discord_webhook', 'hide_filters', 'header_text']) - return Specs(WEBHOOK, False, None) + Specs = namedtuple('Specs', + ['discord_webhook', + 'hide_filters', + 'header_text', + 'footer_text']) + return Specs(WEBHOOK, False, None, None) def test_send_discord_data(session_mocker: MockerFixture, mocked_specs): session_mocker.patch(