test.py: use TestError exception to report errors

Instead of returing True or False, add new TestError
exception class and raise it whenever something fails
in any test case.