'If called with an object that is not an instance of :py:class:`Session`,
or with other than one argument, :py:obj:`Connection.set_session` raises
:py:obj:`TypeError`.'

def test_set_session_wrong_args(self):

    ctx = Context(TLSv1_METHOD)
    connection = Connection(ctx, None)
    self.assertRaises(TypeError, connection.set_session)
    self.assertRaises(TypeError, connection.set_session, 123)
    self.assertRaises(TypeError, connection.set_session, 'hello')
    self.assertRaises(TypeError, connection.set_session, object())
    self.assertRaises(TypeError, connection.set_session, Session(), Session())
