mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-11-22 14:44:22 +00:00
Update test suitw
This commit is contained in:
1 parent
babdc661ac
commit
f45ab94e06
17 files changed
+177
-214
No files matched your search
@@ -8,15 +8,28 @@ import parsedmarc
|
||||
|
||||
|
||||
class Test(unittest.TestCase):
|
||||
def testSamples(self):
|
||||
"""Test sample aggregate DMARC reports"""
|
||||
sample_paths = glob("samples/*.sample")
|
||||
for sample_path in sample_paths:
|
||||
print("Testing {0}...\n".format(sample_path))
|
||||
parsed_report = parsedmarc.parse_aggregate_report_file(sample_path)
|
||||
print(json.dumps(parsed_report, ensure_ascii=False, indent=2))
|
||||
print("\n")
|
||||
print(parsedmarc.parsed_aggregate_reports_to_csv(parsed_report))
|
||||
class Test(unittest.TestCase):
|
||||
def testAggregateSamples(self):
|
||||
"""Test sample aggregate.rua DMARC reports"""
|
||||
sample_paths = glob("samples/aggregate/*")
|
||||
for sample_path in sample_paths:
|
||||
print("Testing {0}...\n".format(sample_path))
|
||||
parsed_report = parsedmarc.parse_aggregate_report_file(
|
||||
sample_path)
|
||||
print(json.dumps(parsed_report, ensure_ascii=False, indent=2))
|
||||
print("\n")
|
||||
print(
|
||||
parsedmarc.parsed_aggregate_reports_to_csv(parsed_report))
|
||||
|
||||
def testForensicSamples(self):
|
||||
"""Test sample forensic/ruf/failure DMARC reports"""
|
||||
sample_paths = glob("samples/forensic/*.eml")
|
||||
for sample_path in sample_paths:
|
||||
print("Testing {0}...\n".format(sample_path))
|
||||
parsed_report = parsedmarc.parse_report_email(sample_path)
|
||||
print(json.dumps(parsed_report, ensure_ascii=False, indent=2))
|
||||
print("\n")
|
||||
print(parsedmarc.parsed_forensic_reports_to_csv(parsed_report))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user