smacademic / project-bdf

project-bdf created by GitHub Classroom
2 stars 0 forks source link

Update and add unit tests #70

Closed calebeda closed 5 years ago

calebeda commented 5 years ago

This PR adds new unit tests for some functions that previously did not have test functions, and this PR also updates previous test functions to use parametrization. Most functions were able to be tested except for the functions that called other functions from within. For example, the function arrayToString() cannot be tested by pytest (Or I have yet to figure out how to test with pytest) due to the fact that it calls escapeMarkdown() when returning the string.

ArrayToStringFailFunction arrayToStringFail

However, if we remove the escapeMarkdown() function from within arrayToString() , then all the test pass as shown below.

arrayToStringPassFunction arrayToStringPass

Due to this issue, I have only implemented parametrized unit testing with pytest for functions that do not call other functions. Currently all of these test functions pass testing.

parametrizedUnitTesting