From d3e98f60259cec89ba8797e7dc003be6108d71ef Mon Sep 17 00:00:00 2001
From: Michael Neumeier <neumeier@fortiss.org>
Date: Tue, 2 May 2023 10:51:54 +0000
Subject: [PATCH] Merged in NRRPLT-8273 (pull request #42)

[NRRPLT-8273] update get_csv_last_run_file

* [NRRPLT-8273] update get_csv_last_run_file

* Merged development into NRRPLT-8273
* [NRRPLT-8273] update test_get_csv_last_run_file in test_simulation

* Merge branch 'NRRPLT-8273' of https://bitbucket.org/hbpneurorobotics/VirtualCoach into NRRPLT-8273

* [NRRPLT-8273] remove unnecessary comment

* Merged development into NRRPLT-8273

Approved-by: Ugo Albanese
Approved-by: Viktor Vorobev
---
 hbp_nrp_virtual_coach/pynrp/simulation.py            | 2 +-
 hbp_nrp_virtual_coach/pynrp/tests/test_simulation.py | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hbp_nrp_virtual_coach/pynrp/simulation.py b/hbp_nrp_virtual_coach/pynrp/simulation.py
index 1b8de48..3b7b621 100644
--- a/hbp_nrp_virtual_coach/pynrp/simulation.py
+++ b/hbp_nrp_virtual_coach/pynrp/simulation.py
@@ -885,7 +885,7 @@ class Simulation(object):
 
         :param file_name: The name of csv file for which to retrieve the content.
         """
-        return self.__vc.get_csv_last_run_file(self.__experiment_id, file_name)
+        return self.__vc.get_last_run_file(self.__experiment_id, 'csv', file_name)
 
     def __send_recorder_cmd(self, cmd):
         """
diff --git a/hbp_nrp_virtual_coach/pynrp/tests/test_simulation.py b/hbp_nrp_virtual_coach/pynrp/tests/test_simulation.py
index 47c72f1..3966622 100644
--- a/hbp_nrp_virtual_coach/pynrp/tests/test_simulation.py
+++ b/hbp_nrp_virtual_coach/pynrp/tests/test_simulation.py
@@ -599,10 +599,10 @@ class TestSimulation(unittest.TestCase):
 
     def test_get_csv_last_run_file(self):
         self._sim._Simulation__vc = Mock()
-        self._sim._Simulation__vc.get_csv_last_run_file = Mock()
+        self._sim._Simulation__vc.get_last_run_file = Mock()
         self._sim._Simulation__experiment_id = 'experiment_id'
         self._sim.get_csv_last_run_file('file_name')
-        self._sim._Simulation__vc.get_csv_last_run_file.assert_called_once_with('experiment_id', 'file_name')
+        self._sim._Simulation__vc.get_last_run_file.assert_called_once_with('experiment_id', 'csv', 'file_name')
 
     def test_recording(self):
         self._sim._Simulation__config = {'simulation-services': {'recorder':'recorder'}}
@@ -623,4 +623,4 @@ class TestSimulation(unittest.TestCase):
         self._sim._Simulation__http_client.post.assert_called_with(u'url/recorder/reset', body='reset')
 
 if __name__ == '__main__':
-    unittest.main()
\ No newline at end of file
+    unittest.main()
-- 
GitLab