test_hwbi_internal.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:hwbi_app 作者: quanted 项目源码 文件源码
def test_cyan_api_endpoints_200():
        test_name = "Check page access "
        try:
            assert_error = False
            response = [requests.get(p).status_code for p in api_endpoints]
            try:
                npt.assert_array_equal(response, 200, '200 error', True)
            except AssertionError:
                assert_error = True
            except Exception as e:
                # handle any other exception
                print("Error '{0}' occured. Arguments {1}.".format(e.message, e.args))
        except Exception as e:
            # handle any other exception
            print("Error '{0}' occured. Arguments {1}.".format(e.message, e.args))
        finally:
            linkcheck_helper.write_report(test_name, assert_error, api_endpoints, response)
        return

# unittest will
# 1) call the setup method,
# 2) then call every method starting with "test",
# 3) then the teardown method
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号