待测试的代码命名为 daiceshi.py
测试代码 ceshi.py
daiceshi.py
def hanshu(xc1,xc2):
a=str(xc1)+str(xc2)
return a
ceshi.py
import unittest
from daiceshi import hanshu
class NameTest(unittest.TestCase):
def test_name(self):
a=hanshu(1,2)
self.assertEqual(a,'12')
unittest.main()