def skip_without_tool(tool_id):
 def method_wrapper(method):
  def get_tool_ids(api_test_case):
   index = api_test_case.galaxy_interactor.get('tools', data=dict(in_panel=False))
   tools = index.json()
   tool_ids = [itemgetter('id')(_) for _ in tools]
   return tool_ids
  def wrapped_method(api_test_case, *args, **kwargs):
   if (tool_id not in get_tool_ids(api_test_case)):
    from nose.plugins.skip import SkipTest
    raise SkipTest()
   return method(api_test_case, *args, **kwargs)
  wrapped_method.__name__ = method.__name__
  return wrapped_method
 return method_wrapper

def skip_without_tool ( tool_id ) : def method_wrapper ( method ) : def get_tool_ids ( api_test_case ) : index = api_test_case . galaxy_interactor . get ( 'tools' , data = dict ( in_panel = False ) ) tools = index . json ( ) tool_ids = [ itemgetter ( 'id' ) ( _ ) for _ in tools ] return tool_ids def wrapped_method ( api_test_case , * args , ** kwargs ) : if ( tool_id not in get_tool_ids ( api_test_case ) ) : from nose . plugins . skip import SkipTest raise SkipTest ( ) return method ( api_test_case , * args , ** kwargs ) wrapped_method . __name__ = method . __name__ return wrapped_method return method_wrapper
decorate an api test method as requiring a specific tool .