Logo Search packages:      
Sourcecode: ubuntu-sso-client version File versions  Download package

def mocker::SpecChecker::run (   self,
  path 
)

Perform the task item, considering that the given action happened.

Reimplemented from mocker::Task.

Definition at line 1867 of file mocker.py.

01867                        :
        if not self._method:
            raise AssertionError("Method not found in real specification")
        if self._unsupported:
            return # Can't check it. Happens with builtin functions. :-(
        action = path.actions[-1]
        obtained_len = len(action.args)
        obtained_kwargs = action.kwargs.copy()
        nodefaults_len = len(self._args) - len(self._defaults)
        for i, name in enumerate(self._args):
            if i < obtained_len and name in action.kwargs:
                self._raise("%r provided twice" % name)
            if (i >= obtained_len and i < nodefaults_len and
                name not in action.kwargs):
                self._raise("%r not provided" % name)
            obtained_kwargs.pop(name, None)
        if obtained_len > len(self._args) and not self._varargs:
            self._raise("too many args provided")
        if obtained_kwargs and not self._varkwargs:
            self._raise("unknown kwargs: %s" % ", ".join(obtained_kwargs))

def spec_checker_recorder(mocker, event):


Generated by  Doxygen 1.6.0   Back to index