cisagov / gophish-tools

Helpful tools for interacting with a GoPhish phishing instance
Creative Commons Zero v1.0 Universal
42 stars 6 forks source link

Update builder #14

Closed bjb28 closed 2 years ago

bjb28 commented 4 years ago

This PR is focused on the builder.py script and the associated tests. The main effort is to replace the test_assessment_json.py with smaller tests that are now located in test_builder.py. Additionally, the PR addresses uncaught errors that were causing crashes and improves overall formatting. The specific commits address the following:

This PR also merged elements from a previous attempted to fix the test_assessment_json.py, #12. The commits form these elements are as follows:

💭 Motivation and Context

Replacing test_assessment_json.py allows for improved testing of the builder.py script. With the new tests functioning, making future changes to the script will be easier to test. Maintaining these smaller tests is much easier than making edits to the test_assessment_json.py. This PR closes #6.

Several other errors were discovered in additional user testing that caused significant problems when exceptions left uncaught. By handing the crashes, the user will not be required to redo the entire wizard as a result of a crash.

Adding the ability to create an email by importing separate HTML and text files makes building complicated emails easier. The alternative requires the user manual convert the same information into a single line for the JSON import. Keeping the import json function is ideal for previously used templates that come from a database.

🧪 Testing

After adding a significant number of new smaller tests, each was run to ensure proper functionality. Manual tests were also conducted to ensure the output of each test was accurate. Multiple full runs of the builder.py script were conducted to ensure the ending JSON was correctly formatted.

📷 Screenshots (if appropriate)

🚥 Types of Changes

✅ Checklist

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging 5a182cda51b73e3687f77536ca0a1cdfdff2e647 into ca2f48087993a731434fd10ca0717555e7b3b00f - view on LGTM.com

new alerts:

BenBreaksThings commented 2 years ago

Created by individual no longer supporting the team or the repository, left unattended and without handoff between development teams. Recommend closing the PR without adopting as the codebase has changed multiple times since PR went dormant and the requirements of the project and the teams supported by the project have evolved. Any future iteration of the intent of this PR to be opened/addressed in a discrete, deliberate PR.