示例#1
0
    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))
示例#2
0
 def test_fooList1_unusual_emptyList(self):
     self.assertRaises(ValueError, foo_lib.fooList([]))
示例#3
0
 def test_fooList1_general(self):
     self.assertEqual(6, foo_lib.fooList([1, 2, 3]))
示例#4
0
 def test_fooList1_corner_singleValue(self):
     self.assertEqual(5, foo_lib.fooList([5]))
示例#5
0
    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))