def test_fooList1_unusual_emptyList_specific_msg(self): with self.assertRaises(ValueError) as err: foo_lib.fooList([]) self.assertEqual("Cannot process empty list", str(err.exception))
def test_fooList1_unusual_emptyList(self): self.assertRaises(ValueError, foo_lib.fooList([]))
def test_fooList1_general(self): self.assertEqual(6, foo_lib.fooList([1, 2, 3]))
def test_fooList1_corner_singleValue(self): self.assertEqual(5, foo_lib.fooList([5]))
def test_fooList1_unusual_stringvalue_specific_msg(self): with self.assertRaises(TypeError) as err: foo_lib.fooList(["5", "6"]) self.assertEqual("Cannot total non-numbers.", str(err.exception))