'Testing whether a correct error message is sent in the tftp handler'

def test_send_error_packet(self):

    def mocked_send_packet(_, packet):
        self.assertEqual(packet['session_id'], 42)
        self.assertEqual(packet['error_code'], 43)
        self.assertEqual(packet['error_msg'], 'test')
    self.handler._send_packet = mocked_send_packet
    mock_session = MockObject()
    mock_session.session_id = 42
    self.handler._send_error_packet(mock_session, 43, 'test')
