zoukankan      html  css  js  c++  java
  • 调用公共方法样例

    import unittest
    from public_method.test_public_get import test_public_get
    from public_method.test_public_post import test_public_post

    # 在写测试类以及测试用例时要规定一个命名习惯,一般测试类可以以Test开头,也可以以Test结尾。测试用例一般是以test开头。

    import unittest #导入unittest包

    class ApiTest(unittest.TestCase): #创建测试类:从unittest.TestCase继承

    #url
    def setUp(self): #初始化测试环境
    self.url2="http://app.shixuncom.com"

    #2 查询评论列表
    def test_post_searchreviewer(self):
    print ("查询评论列表接口执行开始。。。。")
    path = "/info/reviewer/getReviewerListByInfomationId"
    params = dict(infomationId='5b8dfe8f1134535094cae376', pageNum=1,pageSize=2)

    test_public_post(self,self.url2,path,params)
    print("查询评论列表接口执行结束。。。。")

    #注:setUp和tearDown可以选择是否需要
    def teardown(self):
    pass

    #执行测试用例
    if __name__ =="__main__":
    unittest.main()
  • 相关阅读:
    hive metastore && hiveserver2 . 基本配置
    Flink HA 搭建坑
    protobuf 编译安装
    编译Hadoop 2.7.2支持压缩 转
    centos 6挂载磁盘
    python
    python之面向对象(一)
    python
    python-文件压缩和解压
    python-configparser模块
  • 原文地址:https://www.cnblogs.com/lanyy/p/10420749.html
Copyright © 2011-2022 走看看