From 991f3093b576b298c7cefa7c1296f411a4d0afd5 Mon Sep 17 00:00:00 2001 From: Diego Tavares Date: Wed, 11 Dec 2024 08:55:31 -0800 Subject: [PATCH] Fix wrong call to serialize frame --- rqd/rqd/rqcore.py | 2 +- rqd/tests/rqcore_test.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/rqd/rqd/rqcore.py b/rqd/rqd/rqcore.py index 898f9fe66..88f942b57 100644 --- a/rqd/rqd/rqcore.py +++ b/rqd/rqd/rqcore.py @@ -203,7 +203,7 @@ def backupCache(self): return with open(self.backup_cache_path, "wb") as f: for item in list(self.__cache.values()): - serialized = item.SerializeToString() + serialized = item.runFrame.SerializeToString() f.write(len(serialized).to_bytes(4, byteorder="big")) f.write(serialized) diff --git a/rqd/tests/rqcore_test.py b/rqd/tests/rqcore_test.py index 36c6df5f0..6ea29de38 100644 --- a/rqd/tests/rqcore_test.py +++ b/rqd/tests/rqcore_test.py @@ -598,9 +598,10 @@ def test_backupCache_withPath(self, mockOpen): """Test backupCache writes frame data when backup path is configured""" self.rqcore.backup_cache_path = '/tmp/rqd/cache.dat' frameId = 'frame123' - runFrame = mock.MagicMock() - runFrame.SerializeToString.return_value = b'serialized_frame_data' - self.rqcore.storeFrame(frameId, runFrame) + runningFrame = mock.MagicMock() + runningFrame.runFrame = mock.MagicMock() + runningFrame.runFrame.SerializeToString.return_value = b'serialized_frame_data' + self.rqcore.storeFrame(frameId, runningFrame) self.rqcore.backupCache() @@ -663,7 +664,8 @@ def test_recoverCache_validBackup(self): frame_id = frameId, frame_name = "frame_name" ) - self.rqcore.storeFrame(frameId, frame) + running_frame = rqd.rqnetwork.RunningFrame(self.rqcore, frame) + self.rqcore.storeFrame(frameId, running_frame) self.rqcore.backupCache() self.__cache = {} self.rqcore.recoverCache()