def test_admin_list_sharelib(self, api):
reply = {
'sharelib': [
{'name': 'oozie'},
{'name': 'hive'},
{'name': 'distcp'},
{'name': 'hcatalog'},
{'name': 'sqoop'},
{'name': 'mapreduce-streaming'},
{'name': 'spark'},
{'name': 'hive2'},
{'name': 'pig'}
]
}
expected = ['oozie', 'hive', 'distcp', 'hcatalog', 'sqoop', 'mapreduce-streaming', 'spark', 'hive2', 'pig']
with mock.patch.object(api, '_get', return_value=reply) as mock_get:
assert api.admin_list_sharelib() == expected
mock_get.assert_called_with('admin/list_sharelib')
评论列表
文章目录