|
@@ -163,9 +163,24 @@ class DataTest(unittest.TestCase):
|
|
|
speedDataCenter.channl_speed()
|
|
|
|
|
|
def test_profitPrepare(self):
|
|
|
- profitCenter.set_redis('127.0.0.1','6379')
|
|
|
+ profitCenter.set_redis('docker.hostip','6379')
|
|
|
profitCenter.prepare_data()
|
|
|
|
|
|
+
|
|
|
+ def test_json(self):
|
|
|
+ try:
|
|
|
+ x = {'method': 'commit', 'params': {'inprice': 4.5, 'outprice': 12}}
|
|
|
+ print(x)
|
|
|
+ # x = [ { 'a' : 1, 'b' : 2, 'c' : 3, 'd' : 4, 'e' : 5 } ]
|
|
|
+ data = json.dumps(x)
|
|
|
+ print(data)
|
|
|
+ y = json.loads(data)
|
|
|
+ print(y)
|
|
|
+ except Exception as ex:
|
|
|
+ print(ex)
|
|
|
+ finally:
|
|
|
+ pass
|
|
|
+
|
|
|
def test_setcache(self):
|
|
|
import json
|
|
|
r = None
|