def readTest(self, varBind, **context):
        """Test the ability to read Managed Object Instance.

        Implements the first of the two phases of the SNMP GET command
        processing (:RFC:`1905#section-4.2.1`).

        The goal of the first phase is to make sure that requested Managed
        Object Instance could potentially be read. When multiple Managed
        Objects Instances are read at once (likely coming all in one SNMP PDU),
        each of them has to run through the first (*test*) phase successfully
        for the system to transition to the second (*get*) phase.

        The role of this object in the MIB tree is non-terminal. It does not
        access the actual Managed Object Instance, but just traverses one level
        down the MIB tree and hands off the query to the underlying objects.

        Parameters
        ----------
        varBind: :py:class:`~pysnmp.smi.rfc1902.ObjectType` object representing
            Managed Object Instance to read

        Other Parameters
        ----------------
        \*\*context:

            Query parameters:

            * `cbFun` (callable) - user-supplied callable that is invoked to
              pass read Managed Object Instance or an error.

        Notes
        -----
        The callback functions (e.g. `cbFun`) have the same signature as this
        method where `varBind` contains read Managed Object Instance value.

        In case of an error, the `error` key in the `context` dict will contain
        an exception object.
        """
        name, val = varBind

        (debug.logger & debug.FLAG_INS and
         debug.logger('%s: readTest(%s, %r)' % (self, name, val)))

        cbFun = context['cbFun']

        if name == self.name:
            cbFun((name, exval.noSuchInstance), **context)
            return

        node = exc = None

        try:
            node = self.getBranch(name, **context)

        except error.NoSuchObjectError:
            val = exval.noSuchObject

        except error.NoSuchInstanceError:
            val = exval.noSuchInstance

        except error.SmiError as exc:
            (debug.logger & debug.FLAG_INS and
             debug.logger('%s: exception %r' % (self, exc)))

        if not node:
            cbFun((name, val), **dict(context, error=exc))
            return

        node.readTest(varBind, **context)
def readTest ( self , varBind , ** context ) : name , val = varBind ( debug . logger & debug . FLAG_INS and debug . logger ( '%s: readTest(%s, %r)' % ( self , name , val ) ) ) cbFun = context [ 'cbFun' ] if name == self . name : cbFun ( ( name , exval . noSuchInstance ) , ** context ) return node = exc = None try : node = self . getBranch ( name , ** context ) except error . NoSuchObjectError : val = exval . noSuchObject except error . NoSuchInstanceError : val = exval . noSuchInstance except error . SmiError as exc : ( debug . logger & debug . FLAG_INS and debug . logger ( '%s: exception %r' % ( self , exc ) ) ) if not node : cbFun ( ( name , val ) , ** dict ( context , error = exc ) ) return node . readTest ( varBind , ** context )
Test the ability to read Managed Object Instance.

        Implements the first of the two phases of the SNMP GET command
        processing (:RFC:`1905#section-4.2.1`).

        The goal of the first phase is to make sure that requested Managed
        Object Instance could potentially be read. When multiple Managed
        Objects Instances are read at once (likely coming all in one SNMP PDU),
        each of them has to run through the first (*test*) phase successfully
        for the system to transition to the second (*get*) phase.

        The role of this object in the MIB tree is non-terminal. It does not
        access the actual Managed Object Instance, but just traverses one level
        down the MIB tree and hands off the query to the underlying objects.

        Parameters
        ----------
        varBind: :py:class:`~pysnmp.smi.rfc1902.ObjectType` object representing
            Managed Object Instance to read

        Other Parameters
        ----------------
        \*\*context:

            Query parameters:

            * `cbFun` (callable) - user-supplied callable that is invoked to
              pass read Managed Object Instance or an error.

        Notes
        -----
        The callback functions (e.g. `cbFun`) have the same signature as this
        method where `varBind` contains read Managed Object Instance value.

        In case of an error, the `error` key in the `context` dict will contain
        an exception object.