代码拉取完成,页面将自动刷新
同步操作将从 小胖子/SafeTool-51testing 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import unittest
from config import config
from config import interceptConfig as ic
class test(unittest.TestCase):
@classmethod
def setUpClass(cls):
'''
setUp函数之前运行,整个测试过程只执行一次
是所有测试方法最先执行的
'''
pass
def setUp(self):
'''
测试前的初始化工作,写在这里
'''
pass
def test_get_mitm_intercept(self):
conf = config()
url = conf.get_intercept_url()
req = conf.get_intercept_req()
self.assertEqual(type(url),list)
self.assertEqual(False,req)
def test_get_intercept_all(self):
conf = ic()
self.assertEqual(type(conf.get_intercept()),list)
def test_get_intercept_url_req(self):
conf = ic()
req = conf.get_intercept_url_req("test1")
self.assertEqual(req['headers'],"test1_req_headers")
self.assertEqual(req['params'],"test1_req_params")
def test_get_intercept_url_resp(self):
conf = ic()
resp = conf.get_intercept_url_resp("test1")
self.assertEqual(resp['headers'],"test1_resp_headers")
self.assertEqual(resp['params'],"test1_resp_params")
def test_get_mitm_intercept_set_url(self):
conf = config()
url = 'http://127.0.0.1:8080/WebGoat/attack?Screen=32&menu=5'
conf.set_intercept_url(url)
def test_set_intercept_url(self):
conf = ic()
url = 'http://127.0.0.1:8080/WebGoat/attack?Screen=32&menu=5'
conf.set_intercept_url(url)
def test_set_intercept_url_req_headers(self):
conf = ic()
url = 'http://127.0.0.1:8080/WebGoat/attack?Screen=32&menu=5'
headers = "Cookie_JSESSIONID=45FCF83CD2DB1F0A223FFB738C8B3797"
conf.set_intercept_url_req_headers(url,headers)
def test_set_intercept_url_req_params(self):
conf = ic()
url = 'http://127.0.0.1:8080/WebGoat/attack?Screen=32&menu=5'
params = "Screen=32&menu=5"
conf.set_intercept_url_req_params(url,params)
def test_set_intercept_url_resp_headers(self):
conf = ic()
url = 'http://127.0.0.1:8080/WebGoat/attack?Screen=32&menu=5'
headers = "Server_Apache-Coyote/1.1"
conf.set_intercept_url_resp_headers(url,headers)
def test_set_intercept_url_resp_params(self):
conf = ic()
url = 'http://127.0.0.1:8080/WebGoat/attack?Screen=32&menu=5'
params = "head"
conf.set_intercept_url_resp_params(url,params)
def tearDown(self):
'''
测试之前完成后的清理工作
'''
pass
@classmethod
def tearDownClass(cls):
'''
在tearDown之后执行,整个测试过程只执行一次
'''
pass
if __name__ == "__main__":
unittest.main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。