()
| 14 | |
| 15 | |
| 16 | def testSsdbClient(): |
| 17 | from db.dbClient import DbClient |
| 18 | from helper.proxy import Proxy |
| 19 | |
| 20 | uri = "ssdb://@127.0.0.1:8888" |
| 21 | db = DbClient(uri) |
| 22 | db.changeTable("use_proxy") |
| 23 | proxy = Proxy.createFromJson('{"proxy": "118.190.79.36:8090", "https": false, "fail_count": 0, "region": "", "anonymous": "", "source": "freeProxy14", "check_count": 4, "last_status": true, "last_time": "2021-05-26 10:58:04"}') |
| 24 | |
| 25 | print("put: ", db.put(proxy)) |
| 26 | |
| 27 | print("get: ", db.get(https=None)) |
| 28 | |
| 29 | print("exists: ", db.exists("27.38.96.101:9797")) |
| 30 | |
| 31 | print("exists: ", db.exists("27.38.96.101:8888")) |
| 32 | |
| 33 | print("getAll: ", db.getAll(https=None)) |
| 34 | |
| 35 | # print("pop: ", db.pop(https=None)) |
| 36 | |
| 37 | print("clear: ", db.clear()) |
| 38 | |
| 39 | print("getCount", db.getCount()) |
| 40 | |
| 41 | |
| 42 | if __name__ == '__main__': |
no test coverage detected