'If :py:obj:`Connection.set_tlsext_host_name` is called with a non-byte string
argument or a byte string with an embedded NUL or other than one
argument, :py:obj:`TypeError` is raised.'

def test_set_tlsext_host_name_wrong_args(self):

    conn = Connection(Context(TLSv1_METHOD), None)
    self.assertRaises(TypeError, conn.set_tlsext_host_name)
    self.assertRaises(TypeError, conn.set_tlsext_host_name, object())
    self.assertRaises(TypeError, conn.set_tlsext_host_name, 123, 456)
    self.assertRaises(TypeError, conn.set_tlsext_host_name, b('with\x00null'))
    if PY3:
        self.assertRaises(TypeError, conn.set_tlsext_host_name, b('example.com').decode('ascii'))
