Update test suitw

This commit is contained in:
Sean Whalen committed 2018-10-11 19:01:02 -04:00
1 parent babdc661ac
commit f45ab94e06
17 files changed
+177 -214

No files matched your search

+22 -9
View File
@@ -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__":