testsql.py 339 B

123456789101112
  1. # coding:utf-8
  2. from db.SqlHelper import SqlHelper
  3. from util.exception import Con_DB_Fail
  4. try:
  5. sqlhelper = SqlHelper()
  6. sqlhelper.init_db()
  7. except Exception:
  8. raise Con_DB_Fail
  9. proxy = {'ip': '192.168.1.1', 'port': int('80'), 'type': 0, 'protocol': 0, 'country': u'中国', 'area': u'四川', 'speed': 0}
  10. sqlhelper.insert(proxy)