'L{twisted.python.log.showwarning} emits the warning as a message
to the Twisted logging system.'

def test_showwarning(self):

    publisher = log.LogPublisher()
    publisher.addObserver(self.observer)
    publisher.showwarning(FakeWarning('unique    warning    message'), FakeWarning, 'warning-filename.py', 27)
    event = self.catcher.pop()
    self.assertEqual((event['format'] % event), 'warning-filename.py:27:    twisted.test.test_log.FakeWarning:    unique    warning    message')
    self.assertEqual(self.catcher, [])
    publisher.showwarning(FakeWarning('unique    warning    message'), FakeWarning, 'warning-filename.py', 27, line=object())
    event = self.catcher.pop()
    self.assertEqual((event['format'] % event), 'warning-filename.py:27:    twisted.test.test_log.FakeWarning:    unique    warning    message')
    self.assertEqual(self.catcher, [])
