def test_nonZeroExitSignal(self):
        """
        When the command exits with a non-zero signal, the protocol's
        C{connectionLost} method is called with a L{Failure} wrapping an
        exception which encapsulates that status.

        Additional packet contents are logged at the C{info} level.
        """
        logObserver = EventLoggingObserver()
        globalLogPublisher.addObserver(logObserver)
        self.addCleanup(globalLogPublisher.removeObserver, logObserver)

        exitCode = None
        signal = 15
        # See https://tools.ietf.org/html/rfc4254#section-6.10
        packet = b"".join([
            common.NS(b'TERM'),     # Signal name (without "SIG" prefix);
                                    # string
            b'\x01',                # Core dumped; boolean
            common.NS(b'message'),  # Error message; string (UTF-8 encoded)
            common.NS(b'en-US'),    # Language tag; string
        ])
        exc = self._exitStatusTest(b'exit-signal', packet)
        exc.trap(ProcessTerminated)
        self.assertEqual(exitCode, exc.value.exitCode)
        self.assertEqual(signal, exc.value.signal)

        logNamespace = "twisted.conch.endpoints._CommandChannel"
        hamcrest.assert_that(
            logObserver,
            hamcrest.has_item(
                hamcrest.has_entries(
                    {
                        "log_level": hamcrest.equal_to(LogLevel.info),
                        "log_namespace": logNamespace,
                        "shortSignalName": b"TERM",
                        "coreDumped": True,
                        "errorMessage": u"message",
                        "languageTag": b"en-US",
                    },
                )))

        When the command exits with a non-zero signal, the protocol's
        C{connectionLost} method is called with a L{Failure} wrapping an
        exception which encapsulates that status.

        Additional packet contents are logged at the C{info} level.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_endpoints.py