'Testing whether error alerts are processed correctly'

def test_process_error_alert(self):

    url = 'http://google.com'
    mock_alert = MockObject()
    mock_alert.msg = None
    mock_alert.category = (lambda : lt.alert.category_t.error_notification)
    mock_alert.status_code = 123
    mock_alert.url = url
    self.libtorrent_download_impl.process_alert(mock_alert, 'tracker_error_alert')
    self.assertEqual(self.libtorrent_download_impl.tracker_status[url][1], 'HTTP    status    code    123')
    mock_alert.status_code = 0
    self.libtorrent_download_impl.process_alert(mock_alert, 'tracker_error_alert')
    self.assertEqual(self.libtorrent_download_impl.tracker_status[url][1], 'Timeout')
