Ejemplo n.º 1
0
 def stream_output(self, data, stream='stdout', retcode=None, name=None):
     ret = recipe_test_api.StepTestData()
     assert stream in ('stdout', 'stderr')
     step_data = self.output(data, retcode=retcode, name=name)
     setattr(ret, stream, step_data.unwrap_placeholder())
     if retcode:
         ret.retcode = retcode
     return ret
Ejemplo n.º 2
0
 def invalid(self, raw_data_str, retcode=None, name=None):
     """Can be used to supply data for a json.output, except that it takes a raw
 string rather than a json object."""
     ret = recipe_test_api.StepTestData()
     ret.retcode = retcode
     placeholder_data = recipe_test_api.PlaceholderTestData(
         data=raw_data_str, name=name)
     ret.placeholder_data[(self._module.NAME, 'output',
                           name)] = placeholder_data
     return ret
Ejemplo n.º 3
0
def RunSteps(api):
    api.step('Here\'s a step brah', ['echo', 'steppity', 'doo', 'dah'],
             step_test_data=functools.partial(
                 lambda x: recipe_test_api.StepTestData(), None))
Ejemplo n.º 4
0
 def stream_output(self, data, stream='stdout', retcode=None):
     ret = recipe_test_api.StepTestData()
     assert stream in ('stdout', 'stderr')
     setattr(ret, stream, self.output(data, retcode).unwrap_placeholder())
     return ret