def test_list(self):
client = StorageClient("mock://")
adapter = Adapter()
# should probably figure out a better way to do this
client.volumes.session.mount('mock', adapter)
adapter.register_uri('GET', 'mock:///volumes', text=dumps([{
"export": {},
"id": "thrawn",
"name": "thrawn",
"origin": "",
"path": "/dev/lunr-volume/thrawn",
"size": 12582912
}])
)
# List all the volumes on a storage node
volumes = client.volumes.list()
# Asserts
self.assertIn('export', volumes[0])
self.assertIn('id', volumes[0])
self.assertIn('origin', volumes[0])
self.assertIn('path', volumes[0])
self.assertIn('size', volumes[0])
test_storageclient.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录