Coding 2021-05-24

By Max Woerner Chase

I was busy getting vaccinated today, and then trying to take it easy. So, I haven't touched code, but there is something I'm trying to work out.

I have a helper function that wraps errors, both expected and unexpected, from the open function in custom exceptions specific to the application. I want to be sure to test the branches for "I don't know how this happened, but I should account for it". But I can't test those by making the open function do stuff, because if I knew how to encounter those errors, then I'd need to write more specific error messages, and then inducing those errors wouldn't trigger the branches I want to test.

So, if I can't rely on the built-in function to trigger the branches I want to test, then I need to be able to substitute in a different function. I've thought of a few possible ways:

I basically came to that conclusion while I was writing this post in my head, but I figured that was no reason not to write the post on my computer as well.

Anyway, once I take care of this idea, I should be on-track to properly integrate the prototype code and see how it treats me. Hopefully, I'll have that done in a week or two.

Good night.