def test_no_relay_clear_cmd_when_traffic_masking_is_enabled(self, _): # Setup self.settings.traffic_masking = True # Test self.assertIsNone(clear_screens(UserInput('clear'), *self.args)) self.assertEqual(self.queues[TM_COMMAND_PACKET_QUEUE].qsize(), 1) self.assertEqual(self.queues[RELAY_PACKET_QUEUE].qsize(), 0)
def test_no_relay_reset_cmd_when_traffic_masking_is_enabled( self, mock_os_system): # Setup self.settings.traffic_masking = True # Test self.assertIsNone(clear_screens(UserInput('reset'), *self.args)) self.assertEqual(self.queues[TM_COMMAND_PACKET_QUEUE].qsize(), 1) self.assertEqual(self.queues[RELAY_PACKET_QUEUE].qsize(), 0) mock_os_system.assert_called_with(RESET)
def test_clear_screens(self, _): self.assertIsNone(clear_screens(UserInput('clear'), *self.args)) self.assertEqual(self.queues[COMMAND_PACKET_QUEUE].qsize(), 1) self.assertEqual(self.queues[RELAY_PACKET_QUEUE].qsize(), 1)
def test_reset_screens(self, mock_os_system): self.assertIsNone(clear_screens(UserInput('reset'), *self.args)) self.assertEqual(self.queues[COMMAND_PACKET_QUEUE].qsize(), 1) self.assertEqual(self.queues[RELAY_PACKET_QUEUE].qsize(), 1) mock_os_system.assert_called_with(RESET)