cisagov / tpt-reports

Process to build and distribute Technical Phishing Test (TPT) reports
Creative Commons Zero v1.0 Universal
4 stars 0 forks source link

Create tests/test_tpt_reports.py test_parse_json() #21

Closed schmelz21 closed 11 months ago

schmelz21 commented 1 year ago

Test should be created to cover the parse_json() function in the codebase (https://github.com/cisagov/tpt-reports/blob/fb02275022cb7ede818cba07d42f49af31d56db1/src/tpt_reports/tpt_reports.py#L58C1-L107C1).

schmelz21 commented 1 year ago

@schmelz21 - In review to determine the test data: How to apply strategically through multiple tests, and if the data meets repository standards.

schmelz21 commented 1 year ago

Confirmed the test data used locally is sufficient to run the tests.

nickviola commented 1 year ago

@dav3r We are looking to add some test input data for this project to reference in our unittests and general testing of the tool. This data would obviously be redacted and scaled back to be the minimum input to complete the process of generating a pdf.

We would like your opinion on how we approach this. Our current thoughts are that the input data is too large to add as a python dictionary in the test file, so we are thinking of pushing up a redacted test json input file to reside in the path "src/data' or something similar that we can read from.

Do you see any issues with this or have any opinions for alternatives? Thanks in advance!

dav3r commented 1 year ago

@nickviola That sounds like a reasonable plan to me, though if it's truly all test data, then I'd recommend keeping it somewhere within the tests/ directory, rather than the src/ directory.

BTW, this issue would be a lot more useful if there was an actual description of the issue (rather than just a title), preferably using one of our standard issue templates.

nickviola commented 1 year ago

@nickviola That sounds like a reasonable plan to me, though if it's truly all test data, then I'd recommend keeping it somewhere within the tests/ directory, rather than the src/ directory.

BTW, this issue would be a lot more useful if there was an actual description of the issue (rather than just a title), preferably using one of our standard issue templates.

Great! Thank you for the feedback. We definitely need to modify the issue description as well, so we'll get that updated now that we have a more solid plan in place. Thanks again!

nickviola commented 1 year ago

Issue #47 created to capture the above requirements. This issue is currently blocked by #47.