Use unittest methods instead of assert statement