File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
2- from dataclasses import dataclass
2+ from dataclasses import dataclass , field
33import re
44
55from email .message import EmailMessage
@@ -62,10 +62,10 @@ class IntermediateEmail:
6262 rsc_email_supress_scheduled : bool | None = None
6363
6464 # is a list of files in path from current directory
65- external_attachments : list [str ] | None = None
65+ external_attachments : list [str ] = field ( default_factory = list )
6666
6767 # has structure {filename: base64_string}
68- inline_attachments : dict [str , str ] | None = None
68+ inline_attachments : dict [str , str ] = field ( default_factory = dict )
6969
7070 text : str | None = None # sometimes present in quarto
7171 recipients : list [str ] | None = None # not present in quarto
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ def test_creation_without_text_and_attachments():
2727 )
2828 assert email .text is None
2929 assert email .recipients is None
30- assert email .external_attachments is None
31- assert email .inline_attachments is None
30+ assert email .external_attachments == []
31+ assert email .inline_attachments == {}
3232 assert email .subject == "No Text or Attachments"
3333
3434
@@ -94,4 +94,4 @@ def test_not_implemented_methods(method_name):
9494 )
9595 method = getattr (email , method_name )
9696 with pytest .raises (NotImplementedError ):
97- method ()
97+ method ()
You can’t perform that action at this time.
0 commit comments