This PR represents the initial stages of unit testing for the project. It utilizes the pytest unit testing framework. It tests the extractURL function and the tesseractTranscribe function. These are the most base level functions in or code at the moment. I considered testing the transcribeImages and the findTextInSubreddit functions, however these presented challenges for unit testing that we may or may not want to address in the future.
The findTextInSubreddit function in particular is challenging to unit test as it requires a connection to reddit and it searches through a specified subreddit for URLs. This is obviously subject to change frequently as more posts are created in the subreddit with more URLs. This will cause issues with our unit testing as we would need to identify and add new images as they are added to the subreddit. An alternative to this would be to create a unit test subreddit that will be mostly static and any changes will be automatically added to our unit tests.
Going forward we should strive to create unit tests for all functions that we create.
This PR represents the initial stages of unit testing for the project. It utilizes the
pytest
unit testing framework. It tests theextractURL
function and thetesseractTranscribe
function. These are the most base level functions in or code at the moment. I considered testing thetranscribeImages
and thefindTextInSubreddit
functions, however these presented challenges for unit testing that we may or may not want to address in the future.The
findTextInSubreddit
function in particular is challenging to unit test as it requires a connection to reddit and it searches through a specified subreddit for URLs. This is obviously subject to change frequently as more posts are created in the subreddit with more URLs. This will cause issues with our unit testing as we would need to identify and add new images as they are added to the subreddit. An alternative to this would be to create a unit test subreddit that will be mostly static and any changes will be automatically added to our unit tests.Going forward we should strive to create unit tests for all functions that we create.