def test_sendVersion(self):
        """
        Test that the first thing sent over the connection is the version
        string.  The 'softwareversion' part must consist of printable
        US-ASCII characters, with the exception of whitespace characters and
        the minus sign.

        RFC 4253, section 4.2.
        """
        # the other setup was done in the setup method
        version = self.transport.value().split(b'\r\n', 1)[0]
        self.assertEqual(version,
                         b"SSH-2.0-Twisted_" + twisted_version.encode('ascii'))
        softwareVersion = version.decode('ascii')[len('SSH-2.0-'):]
        # This is an inefficient regex, but it's simple to build.
        softwareVersionRegex = (
            r'^(' +
            '|'.join(
                re.escape(c) for c in string.printable
                if c != '-' and not c.isspace()) +
            r')*$')
        self.assertRegex(softwareVersion, softwareVersionRegex)

        Test that the first thing sent over the connection is the version
        string.  The 'softwareversion' part must consist of printable
        US-ASCII characters, with the exception of whitespace characters and
        the minus sign.

        RFC 4253, section 4.2.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_transport.py