Extend TestInvisibleInk and fix TestDigramCounter #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds functional test to TestInvisibleInk, fixes cross-platform test inconsistencies in TestDigramCounter, and adds PR template.
Description
Rather than manually changing the invisible ink color to red, running the demo main function, and checking the file, the color of the unit test's encrypted message can be checked using
python-docx
. It's kind of a test-ception importingpython-docx
to load the test file and check its color, but it ensures that even the encrypted message's color is correct.The problem with including a file system word dictionary in unit tests is that not all file systems have the same word dictionary, much less in the same location. While running tests in Debian, the word dictionary ended up being in the same location (luckily), but had different words in it. The demo main function's word dictionary file path is now patched to use a test word dictionary. This should also make the tests run marginally faster.
The running gag gone wild has become so frequent that I have to acknowledge I make more PRs than I intended to. A PR template is now available to make my pseudo-blog more efficient for myself and to allow others to provide any optimizations they know of.
Having that said, I know I said in #1 that a PR seems unnecessary and wasteful; however, I must emphasize that this is one of the most important steps to foster a community of completeness and openness ever.
Team Notifications
Me, myself, and I