2022-08-06 23:26:04 +08:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
|
|
class TestUnittestAssertions(unittest.TestCase):
|
|
|
|
def testEqual(self):
|
2022-08-11 17:21:01 +08:00
|
|
|
print("in testEqual...")
|
2022-08-06 23:26:04 +08:00
|
|
|
self.assertEqual(0, 0)
|
|
|
|
|
|
|
|
def testTrue(self):
|
2022-08-11 17:21:01 +08:00
|
|
|
print("in testTrue...")
|
2022-08-06 23:26:04 +08:00
|
|
|
self.assertTrue(True)
|
|
|
|
|
|
|
|
def testFalse(self):
|
2022-08-11 17:21:01 +08:00
|
|
|
print("in testFalse...")
|
2022-08-06 23:26:04 +08:00
|
|
|
self.assertFalse(False)
|
|
|
|
|
2022-08-11 18:32:53 +08:00
|
|
|
suit = unittest.TestSuite("test1")
|
2022-08-06 23:26:04 +08:00
|
|
|
suit.addTest(TestUnittestAssertions())
|
|
|
|
runner = unittest.TextTestRunner()
|
2022-08-11 19:21:53 +08:00
|
|
|
res = runner.run(suit)
|