Closed bjb28 closed 2 years ago
This pull request introduces 1 alert when merging 5a182cda51b73e3687f77536ca0a1cdfdff2e647 into ca2f48087993a731434fd10ca0717555e7b3b00f - view on LGTM.com
new alerts:
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.
This PR is focused on the
builder.py
script and the associated tests. The main effort is to replace thetest_assessment_json.py
with smaller tests that are now located intest_builder.py
. Additionally, the PR addresses uncaught errors that were causing crashes and improves overall formatting. The specific commits address the following:review_campaign
to draw groups and pages through the appropriate select functions. b1f28a64build_pages
. debf70717build_assessment
,build_campaigns
, andbuild_pages
. cafb0619 2a4be45 41a0a02e 9eebd9a7This PR also merged elements from a previous attempted to fix the
test_assessment_json.py
, #12. The commits form these elements are as follows:csv.DictReader
andmock to provide email csv data.536ce8de001e8a 4fd96c1build.py
. 4fd96c1PatchRemoved in 97d750fdocopt
to get the initial test to run. 36089bcMockRemoved in 97d750fopen
to prevent the test form looking for the files. 536ce8dMockRemoved in 97d750fjson.load
to load what would have been read from a file. 536ce8d💭 Motivation and Context
Replacing
test_assessment_json.py
allows for improved testing of thebuilder.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 thetest_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