forked from p15670423/monkey
测试:提交代码
This commit is contained in:
parent
0382831701
commit
f5bfdc430c
|
@ -0,0 +1,21 @@
|
||||||
|
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)
|
Loading…
Reference in New Issue