def test_wipe(self, *_): # Setup for _ in range(2): self.queues[COMMAND_PACKET_QUEUE].put("dummy command") self.queues[RELAY_PACKET_QUEUE].put("dummy packet") # Test self.assertIsNone(wipe(*self.args)) wipe_packet = UNENCRYPTED_DATAGRAM_HEADER + UNENCRYPTED_WIPE_COMMAND self.assertTrue( self.queues[RELAY_PACKET_QUEUE].get().startswith(wipe_packet))
def test_wipe_local_testing(self, *_): # Setup self.settings.local_testing_mode = True self.gateway.settings.data_diode_sockets = True for _ in range(2): self.queues[COMMAND_PACKET_QUEUE].put("dummy command") self.queues[RELAY_PACKET_QUEUE].put("dummy packet") # Test self.assertIsNone(wipe(*self.args)) wipe_packet = UNENCRYPTED_DATAGRAM_HEADER + UNENCRYPTED_WIPE_COMMAND self.assertTrue( self.queues[RELAY_PACKET_QUEUE].get().startswith(wipe_packet))