MCPcopy
hub / github.com/jhao104/proxy_pool / testRedisClient

Function testRedisClient

test/testRedisClient.py:16–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14
15
16def testRedisClient():
17 from db.dbClient import DbClient
18 from helper.proxy import Proxy
19
20 uri = "redis://:pwd@127.0.0.1:6379"
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("pop: ", db.pop(https=None))
34
35 print("getAll: ", db.getAll(https=None))
36
37 print("getCount", db.getCount())
38
39
40if __name__ == '__main__':

Callers 1

testRedisClient.pyFile · 0.85

Calls 9

changeTableMethod · 0.95
putMethod · 0.95
getMethod · 0.95
existsMethod · 0.95
popMethod · 0.95
getAllMethod · 0.95
getCountMethod · 0.95
DbClientClass · 0.90
createFromJsonMethod · 0.80

Tested by

no test coverage detected