pickhardtpayments icon indicating copy to clipboard operation
pickhardtpayments copied to clipboard

added a few test cases to showcase how tests #8 may potentially be fixed

Open renepickhardt opened this issue 3 years ago • 3 comments

This is an example showing how unit tests could be added which would be a first step towards fixing #8 .

However I am not sure if this is really the right way. There is a lot of exception handling and boiler plate code now already in a simple setter / getter function.

In any case one can run the tests via:

cd test
python3 -m unittest testUncertaintyChannel.py

renepickhardt avatar May 15 '22 10:05 renepickhardt

Wouldn't be easier to use pytest? They have less boilerplate. I can give a hand if you like.

carlosds731 avatar May 15 '22 11:05 carlosds731

Haven't checked pytest so if you want to provide an alternative example I will be happy to check it out and greatful!

But my question is also about the production code that now has so much more checks for a single value assignment.

I just wonder if I should focus on tests or applications / showcases of the lib. I guess we gonna need both.

renepickhardt avatar May 15 '22 12:05 renepickhardt

Both, for sure

Haven't checked pytest so if you want to provide an alternative example I will be happy to check it out and greatful!

But my question is also about the production code that now has so much more checks for a single value assignment.

I just wonder if I should focus on tests or applications / showcases of the lib. I guess we gonna need both.

carlosds731 avatar May 15 '22 13:05 carlosds731