1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5d88d8b71662/ Changeset: 5d88d8b71662 User: jmchilton Date: 2014-04-28 21:38:45 Summary: Tools API Improvements. Ablity to require tool for API test. Fix test_index for tool panels containing tools outside a section. Affected #: 1 file
diff -r a3b4e0950ae60007af2efcc257a78be6dbe7ca7a -r 5d88d8b716623e06dcc2dbca442c5f52c0a43389 test/functional/api/test_tools.py --- a/test/functional/api/test_tools.py +++ b/test/functional/api/test_tools.py @@ -1,6 +1,4 @@ # Test tools API. -from itertools import chain - from base import api from operator import itemgetter from .helpers import DatasetPopulator @@ -13,22 +11,16 @@ self.dataset_populator = DatasetPopulator( self.galaxy_interactor )
def test_index( self ): - index = self._get( "tools" ) - tools_index = index.json() - # In panels by default, so flatten out sections... - tools = list( chain( *map( itemgetter( "elems" ), tools_index ) ) ) - tool_ids = map( itemgetter( "id" ), tools ) + tool_ids = self.__tool_ids() assert "upload1" in tool_ids - assert "cat1" in tool_ids
def test_no_panel_index( self ): - index = self._get( "tools", data=dict(in_panel="false") ) + index = self._get( "tools", data=dict( in_panel="false" ) ) tools_index = index.json() # No need to flatten out sections, with in_panel=False, only tools are # returned. tool_ids = map( itemgetter( "id" ), tools_index ) assert "upload1" in tool_ids - assert "cat1" in tool_ids
def test_upload1_paste( self ): history_id = self.dataset_populator.new_history() @@ -58,6 +50,7 @@ self.assertEquals( result_content, table )
def test_run_cat1( self ): + self.__skip_without_tool( "cat1" ) # Run simple non-upload tool with an input data parameter. history_id = self.dataset_populator.new_history() new_dataset = self.dataset_populator.new_dataset( history_id, content='Cat1Test' ) @@ -72,6 +65,7 @@ self.assertEqual( output1_content.strip(), "Cat1Test" )
def test_run_cat1_with_two_inputs( self ): + self.__skip_without_tool( "cat1" ) # Run tool with an multiple data parameter and grouping (repeat) history_id = self.dataset_populator.new_history() new_dataset1 = self.dataset_populator.new_dataset( history_id, content='Cat1Test' ) @@ -118,6 +112,25 @@ self._assert_status_code_is( display_response, 200 ) return display_response.content
+ def __tool_ids( self ): + index = self._get( "tools" ) + tools_index = index.json() + # In panels by default, so flatten out sections... + tools = [] + for tool_or_section in tools_index: + if "elems" in tool_or_section: + tools.extend( tool_or_section[ "elems" ] ) + else: + tools.append( tool_or_section ) + + tool_ids = map( itemgetter( "id" ), tools ) + return tool_ids + + def __skip_without_tool( self, tool_id ): + from nose.plugins.skip import SkipTest + if tool_id not in self.__tool_ids( ): + raise SkipTest( ) +
def dataset_to_param( dataset ): return dict(
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
galaxy-commits@lists.galaxyproject.org