diff --git a/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/tests/test_virtual_coach.py b/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/tests/test_virtual_coach.py index 3c2509a21cff829c81b4da9c419aedd1fa5a266a..5732654ba8077b9db9ff333a52402e279af2677a 100644 --- a/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/tests/test_virtual_coach.py +++ b/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/tests/test_virtual_coach.py @@ -320,7 +320,7 @@ mock-server-5 mock_response.content = json.dumps(self._mock_exp_list_cloned) mock_request.return_value = mock_response exp_list = self._vc._VirtualCoach__get_experiment_list(cloned=True) - self.assertEqual(exp_list, ['MockExperiment1_0', 'MockExperiment2_0']) + self.assertEqual(exp_list, {'MockExperiment2_0': {'uuid': 'MockExperiment2_0', 'name': 'MockExperiment2_0'}, 'MockExperiment1_0': {'uuid': 'MockExperiment1_0', 'name': 'MockExperiment1_0'}}) @patch('getpass.getpass', return_value='password') def test_launch_asserts(self, mock_getpass): diff --git a/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/virtual_coach.py b/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/virtual_coach.py index 10221b8b17ecaf03c16bdc61dd4958234ac01e6f..bfc402cf3d3795d0cd559c999a020088123afaa3 100644 --- a/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/virtual_coach.py +++ b/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/virtual_coach.py @@ -159,13 +159,13 @@ class VirtualCoach(object): logger.info('List of production%s experiments:', '' if not dev else ' and development') print table.draw() - def print_running_experiments(self): + def print_running_experiments(self, cloned=False): """ Prints a table of currently running experiments and relevant details (if any). """ # retrieve and parse the current experiment list - exp_list = self.__get_experiment_list() + exp_list = self.__get_experiment_list(cloned) # construct a table with minimal useful information table = Texttable() @@ -405,7 +405,7 @@ class VirtualCoach(object): response = requests.get(url, headers=headers) # return a simple list containing only experiment names since this is the only # information in the dictionary anyway - return [experiment['name'] for experiment in json.loads(response.content)] + return {experiment['name']: experiment for experiment in json.loads(response.content)} else: _, response = self.__http_client.get( self.__config['proxy-services']['experiment-list'])