From 8fefc11380cf2a5f468812d7c5e6909a3f70c605 Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Wed, 7 Feb 2024 19:54:54 +0100 Subject: [PATCH] fixed more tests --- modem/arq_data_type_handler.py | 5 ++--- modem/config.ini.example | 4 ++-- tests/test_message_p2p.py | 9 +++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modem/arq_data_type_handler.py b/modem/arq_data_type_handler.py index b85f7cd4..4de79f13 100644 --- a/modem/arq_data_type_handler.py +++ b/modem/arq_data_type_handler.py @@ -96,8 +96,7 @@ class ARQDataTypeHandler: return def transmitted_raw(self, data): - decompressed_data = lzma.decompress(data) - return decompressed_data + return data def prepare_raw_lzma(self, data): compressed_data = lzma.compress(data) @@ -130,7 +129,7 @@ class ARQDataTypeHandler: return def transmitted_raw_gzip(self, data): - decompressed_data = lzma.decompress(data) + decompressed_data = gzip.decompress(data) return decompressed_data def prepare_p2pmsg_lzma(self, data): diff --git a/modem/config.ini.example b/modem/config.ini.example index 94188aab..b858afb0 100644 --- a/modem/config.ini.example +++ b/modem/config.ini.example @@ -1,11 +1,11 @@ [NETWORK] -modemport = 5000 +modemport = 3050 [STATION] mycall = XX1XXX mygrid = JN18cv myssid = 6 -ssid_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] +ssid_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] enable_explorer = True enable_stats = True diff --git a/tests/test_message_p2p.py b/tests/test_message_p2p.py index 5930fbbc..93782235 100755 --- a/tests/test_message_p2p.py +++ b/tests/test_message_p2p.py @@ -65,11 +65,12 @@ class TestDataFrameFactory(unittest.TestCase): self.assertEqual(message.origin, received_message.origin) self.assertEqual(message.destination, received_message.destination) self.assertCountEqual(message.attachments, received_message.attachments) - # FIXME... - #self.assertEqual(attachment['data'], received_message.attachments[0]['data']) + result = self.database_manager.get_message_by_id(message.id) + self.assertEqual(result["is_read"], True) + self.assertEqual(result["destination"], message.destination) + + - result = self.database_manager.get_all_messages() - self.assertEqual(result[0]["destination"], message.destination) if __name__ == '__main__':