Use self.assertRaises to raise an exception
Clean up the codes
Modifty the test function for a single step