Skip to content

Commit f1e5b23

Browse files
committed
Add begin and end date range to the renders (#12)
1 parent 218e27e commit f1e5b23

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

DMARCReporting/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
headers = [
2+
"Begin Date",
3+
"End Date",
24
"Source IP",
35
"Source Host",
46
"Payload From (From:)",

tests/test_console_renderer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def test_render_with_data():
3131

3232
data = [
3333
[
34+
"begin_date",
35+
"end_date",
3436
"source_ip",
3537
"source_host",
3638
"payload_from",
@@ -49,9 +51,9 @@ def test_render_with_data():
4951
sut.render("ruareport_file", data)
5052

5153
expected = (
52-
"Source IP Source Host Payload From (From:) Envelop From (MAIL FROM) DMARC DKIM Align DKIM Auth SPF Align SPF Auth Count File\n" # noqa E501
53-
"----------- ------------- ---------------------- -------------------------- ----------------- ------------ ----------- ----------- ---------- ------- --------------\n" # noqa E501
54-
"source_ip source_host payload_from envelop_from dmarc_disposition dkim_aligned dkim_auth spf_aligned spf_auth 42 ruareport_file\n" # noqa E501
54+
"Begin Date End Date Source IP Source Host Payload From (From:) Envelop From (MAIL FROM) DMARC DKIM Align DKIM Auth SPF Align SPF Auth Count File\n" # noqa E501
55+
"------------ ---------- ----------- ------------- ---------------------- -------------------------- ----------------- ------------ ----------- ----------- ---------- ------- --------------\n" # noqa E501
56+
"begin_date end_date source_ip source_host payload_from envelop_from dmarc_disposition dkim_aligned dkim_auth spf_aligned spf_auth 42 ruareport_file\n" # noqa E501
5557
)
5658
actual = output.getvalue()
5759

tests/test_csv_renderer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_render_without_data():
1515
sut = CSVRenderer()
1616
sut.render(csv_file, data)
1717

18-
expected = "Source IP,Source Host,Payload From (From:),Envelop From (MAIL FROM),DMARC,DKIM Align,DKIM Auth,SPF Align,SPF Auth,Count,File\n" # noqa E501
18+
expected = "Begin Date,End Date,Source IP,Source Host,Payload From (From:),Envelop From (MAIL FROM),DMARC,DKIM Align,DKIM Auth,SPF Align,SPF Auth,Count,File\n" # noqa E501
1919
actual = open(csv_file, "r").read()
2020

2121
assert expected == actual
@@ -31,6 +31,8 @@ def test_render_with_data():
3131

3232
data = [
3333
[
34+
"begin_date",
35+
"end_date",
3436
"source_ip",
3537
"source_host",
3638
"payload_from",
@@ -49,8 +51,8 @@ def test_render_with_data():
4951
sut.render(csv_file, data)
5052

5153
expected = (
52-
"Source IP,Source Host,Payload From (From:),Envelop From (MAIL FROM),DMARC,DKIM Align,DKIM Auth,SPF Align,SPF Auth,Count,File\n" # noqa E501
53-
"source_ip,source_host,payload_from,envelop_from,dmarc_disposition,dkim_aligned,dkim_auth,spf_aligned,spf_auth,42,ruareport_file\n" # noqa E501
54+
"Begin Date,End Date,Source IP,Source Host,Payload From (From:),Envelop From (MAIL FROM),DMARC,DKIM Align,DKIM Auth,SPF Align,SPF Auth,Count,File\n" # noqa E501
55+
"begin_date,end_date,source_ip,source_host,payload_from,envelop_from,dmarc_disposition,dkim_aligned,dkim_auth,spf_aligned,spf_auth,42,ruareport_file\n" # noqa E501
5456
)
5557
actual = actual = open(csv_file, "r").read()
5658

0 commit comments

Comments
 (0)