From 2dedcc866feb2c1e2353f578ba26eda2b94f913e Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Sun, 4 Aug 2024 23:53:53 +0700 Subject: [PATCH] Create test_network.py --- .../pi_network/daictd/tests/test_network.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 blockchain_integration/pi_network/daictd/tests/test_network.py diff --git a/blockchain_integration/pi_network/daictd/tests/test_network.py b/blockchain_integration/pi_network/daictd/tests/test_network.py new file mode 100644 index 000000000..ab7ed1550 --- /dev/null +++ b/blockchain_integration/pi_network/daictd/tests/test_network.py @@ -0,0 +1,20 @@ +import unittest +from network import Network + +class TestNetwork(unittest.TestCase): + def setUp(self): + self.network = Network() + + def test_send_data(self): + # Test sending data over the network + data = [...] + self.network.send_data(data) + self.assertTrue(self.network.is_connected) + + def test_receive_data(self): + # Test receiving data from the network + data = self.network.receive_data() + self.assertIsInstance(data, list) + +if __name__ == '__main__': + unittest.main()