renepickhardt / pickhardtpayments

python package to showcase, test and build your own version of Pickhardt Payments
Apache License 2.0
42 stars 14 forks source link

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

Open renepickhardt opened 2 years ago

renepickhardt commented 2 years ago

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
carlosds731 commented 2 years ago

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

renepickhardt commented 2 years ago

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 commented 2 years ago

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.