seldom icon indicating copy to clipboard operation
seldom copied to clipboard

请问可以支持https测试吗?

Open yinzuopu opened this issue 3 years ago • 2 comments

yinzuopu avatar Mar 06 '22 02:03 yinzuopu

如果支持,有demo参考吗?谢谢~

yinzuopu avatar Mar 06 '22 02:03 yinzuopu

同 requests 用法保持一致,不需要特别适配。

  • requests
>>> import requests
>>> r = requests.get('https://api.github.com/events')
>>> r.text
u'[{"repository":{"open_issues":0,"url":"https://github.com/...
  • seldom
import seldom


class TestAPI(seldom.TestCase):

    def test_https(self):
        self.get("https://api.github.com/events",)


if __name__ == '__main__':
    seldom.main(debug=True)

运行结果:

python .\test_https.py

              __    __
   ________  / /___/ /___  ____ ____
  / ___/ _ \/ / __  / __ \/ __ ` ___/
 (__  )  __/ / /_/ / /_/ / / / / / /
/____/\___/_/\__,_/\____/_/ /_/ /_/  v2.5.0
-----------------------------------------
                             @itest.info

.\test_https.py
test_https (test_https.TestAPI) ...
------------------ Request ---------------------[🚀]
[method]: GET      [url]: https://api.github.com/events

------------------ Response --------------------[🛬️]
[type]: json

[response]:
 [{'id': '20603704739', 'type': 'PushEvent', 'actor': .....

defnngj avatar Mar 06 '22 17:03 defnngj