Answer the question
In order to leave comments, you need to log in
How to test a validator in an abstract class?
There is an abstract class, it has a setter that calls the private validator function. The validator returns False or True, in case of False the setter throws a ValueError exception.
What is the correct way to write a test for this validator?
If it’s more or less clear with checking for invalid data (there is unittest.assertRaises()), then I can’t figure out how to check for correct execution on valid data.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question