forked from p15670423/monkey
22 lines
482 B
Python
22 lines
482 B
Python
|
import unittest
|
||
|
from mock import Mock
|
||
|
|
||
|
|
||
|
def VerifyPhone():
|
||
|
'''
|
||
|
校验用户手机号
|
||
|
'''
|
||
|
pass
|
||
|
|
||
|
|
||
|
class TestVerifyPhone(unittest.TestCase):
|
||
|
|
||
|
def test_verify_phone(self):
|
||
|
data = {"code": "0000", "msg": {"result": "success", "phoneinfo": "移动用户"}}
|
||
|
VerifyPhone = Mock(return_value=data)
|
||
|
self.assertEqual("success", VerifyPhone()["msg"]["result"])
|
||
|
print('测试用例')
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
unittest.main(verbosity=2)
|