testProxyClass.py 671 B

123456789101112131415161718192021222324252627282930313233
  1. # -*- coding: utf-8 -*-
  2. """
  3. -------------------------------------------------
  4. File Name: testProxyClass
  5. Description :
  6. Author : JHao
  7. date: 2019/8/8
  8. -------------------------------------------------
  9. Change Activity:
  10. 2019/8/8:
  11. -------------------------------------------------
  12. """
  13. __author__ = 'JHao'
  14. import json
  15. from helper import Proxy
  16. def testProxyClass():
  17. proxy = Proxy("127.0.0.1:8080")
  18. print(proxy.info_dict)
  19. proxy.source = "test"
  20. proxy_str = json.dumps(proxy.info_dict, ensure_ascii=False)
  21. print(proxy_str)
  22. print(Proxy.newProxyFromJson(proxy_str).info_dict)
  23. testProxyClass()