def test_generate_conf_from_json():
conf = API.get_conf(name='global')
json = conf.to_json()
conf2 = API.generate_object(json)
assert(conf2.__class__.__name__ == conf.__class__.__name__)
for key in conf.data.keys():
v = conf.data[key]
v2 = conf2.data[key]
if type(v) == types.ListType:
assert(len(v) == len(v2))
for s in v:
assert(v2.count(s) == 1)
elif type(v) == types.DictType:
for key in v.keys():
assert(str(v[key]) == str(v2[key]))
else:
assert(str(v) == str(v2))
test_cluster_configuration.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录