Exemplo n.º 1
0
  def testInvokeArgNamesFunc(self):
    def test_function(a, b):
      return a

    with mock.patch(
        'recipe_engine.loader._invoke_with_properties') as mocked_invoke:
      loader.invoke_with_properties(test_function, None, None)
      args, _ = mocked_invoke.call_args
      self.assertTrue(['a', 'b'] in args)
Exemplo n.º 2
0
  def testInvokeArgNamesFunc(self):
    def test_function(a, b):
      return a

    with mock.patch(
        'recipe_engine.loader._invoke_with_properties') as mocked_invoke:
      loader.invoke_with_properties(test_function, None, None, None)
      args, _ = mocked_invoke.call_args
      self.assertTrue(['a', 'b'] in args)
Exemplo n.º 3
0
  def testInvokeArgNamesClass(self):
    class TestClass(object):
      def __init__(self, api, foo, bar):
        pass

    with mock.patch(
        'recipe_engine.loader._invoke_with_properties') as mocked_invoke:
      loader.invoke_with_properties(TestClass, None, None)
      args, _ = mocked_invoke.call_args
      self.assertTrue(['api', 'foo', 'bar'] in args)
Exemplo n.º 4
0
  def testInvokeArgNamesClass(self):
    class TestClass(object):
      def __init__(self, api, foo, bar):
        pass

    with mock.patch(
        'recipe_engine.loader._invoke_with_properties') as mocked_invoke:
      loader.invoke_with_properties(TestClass, None, None, None)
      args, _ = mocked_invoke.call_args
      self.assertTrue(['api', 'foo', 'bar'] in args)
Exemplo n.º 5
0
 def invoke(self, callable, all_properties, prop_defs, **kwargs):
     return loader.invoke_with_properties(callable, all_properties,
                                          prop_defs, **kwargs)
Exemplo n.º 6
0
 def invoke(self, callable, all_properties, prop_defs, **kwargs):
   return loader.invoke_with_properties(
       callable, all_properties, prop_defs, **kwargs)