def on(self, method, path=None, headers=None, text=None, json=None):
        '''
        Sends response to matching parameters one time and removes it from list of expectations

        :type method: str
        :param method: request method: ``'GET'``, ``'POST'``, etc. can be some custom string

        :type path: str
        :param path: request path including query parameters

        :type headers: dict
        :param headers: dictionary of headers to expect. If omitted any headers will do

        :type text: str
        :param text: request text to expect. If ommited any text will match

        :type json: dict
        :param json: request json to expect. If ommited any json will match,
            if present text param will be ignored

        :rtype: Rule
        :returns: newly created expectation rule
        '''
        rule = Rule(method, path, headers, text, json)
        return self._add_rule_to(rule, self._rules)
def on ( self , method , path = None , headers = None , text = None , json = None ) : rule = Rule ( method , path , headers , text , json ) return self . _add_rule_to ( rule , self . _rules )
Sends response to matching parameters one time and removes it from list of expectations

        :type method: str
        :param method: request method: ``'GET'``, ``'POST'``, etc. can be some custom string

        :type path: str
        :param path: request path including query parameters

        :type headers: dict
        :param headers: dictionary of headers to expect. If omitted any headers will do

        :type text: str
        :param text: request text to expect. If ommited any text will match

        :type json: dict
        :param json: request json to expect. If ommited any json will match,
            if present text param will be ignored

        :rtype: Rule
        :returns: newly created expectation rule