unittest常用的斷言方法 1.assertEqual(self, a, b msg=None) --判斷兩個參數相等:a == b 2.assertNotEqual(self, a, b, msg=None) --判斷兩個參數不相等:a != b 3.assertIn(self, hello,helloword, msg=None) --判斷是字符串是否包含:hello in helloword
4.asserNotIn(self,s,hello,msg=None) --判斷是字符串是否不包含:s not in hello 5.assertTrue(self, a, msg=None) --判斷是否為真:a is True 6.assertFalse(self, b, msg=None) --判斷是否為假:b is False 7.assertIsNone(self, c, msg=None) --判斷是否為None:c is None 8.assertIsNotNone(self, d, msg=None) --判斷是否不為None:d is not None