def test_returns_objective_list(self, mock_list): res = List({'<asset>': 'objective'}).run() self.assertEqual(json.loads(res)['status_code'], 200) self.assertEqual(json.loads(res)['result'], flatten(objective)) self.assertEqual(len(mock_list.call_args_list), 1)
def test_returns_data_manager_list(self, mock_list): res = List({'<asset>': 'data_manager'}).run() self.assertEqual(json.loads(res)['status_code'], 200) self.assertEqual(json.loads(res)['result'], flatten(data_manager)) self.assertEqual(len(mock_list.call_args_list), 1)
def test_returns_objective_list_filters(self, mock_list): res = List({ '<asset>': 'objective', '<filters>': '["objective:name:Skin Lesion Classification Challenge", "OR", "data_manager:name:Simplified ISIC 2018"]' }).run() self.assertEqual(json.loads(res)['status_code'], 200) self.assertEqual(json.loads(res)['result'], flatten(objective)) self.assertEqual(len(mock_list.call_args_list), 1)
def mocked_client_list_asset(data, st): return {'result': flatten(data), 'status_code': st}