1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/24753d36e6a6/ Changeset: 24753d36e6a6 User: jmchilton Date: 2014-01-31 05:44:10 Summary: Improved jobs testing.
Fix bug in buildbot related to differences between local handling of list/tuple parameters and requests handling (I mostly use requests locally, but buildbot doesn't have it available). Add test that fails without @kellrott's pull request #314 (and in turn verifies it fixes a problem). Affected #: 2 files
diff -r 2ce1ba52c6a7b33676ffebb73053ab3f9e9baa21 -r 24753d36e6a60bb446bd961d16cb4b59abf7b13b test/base/interactor.py --- a/test/base/interactor.py +++ b/test/base/interactor.py @@ -1,6 +1,7 @@ import os from StringIO import StringIO from galaxy.tools.parameters import grouping +from galaxy.util import listify from galaxy.util.odict import odict import galaxy.model from galaxy.model.orm import and_, desc @@ -440,7 +441,16 @@ argsep = '&' if '?' not in url: argsep = '?' - url = url + argsep + '&'.join( [ '%s=%s' % (k, v) for k, v in params.iteritems() ] ) + param_pairs = [] + for key, value in params.iteritems(): + # Handle single parameters or lists and tuples of them. + if isinstance( value, tuple ): + value = list( value ) + elif not isinstance( value, list ): + value = [ value ] + for val in value: + param_pairs.append( "%s=%s" % ( key, val ) ) + url = url + argsep + '&'.join( param_pairs ) #req = urllib2.Request( url, headers = { 'Content-Type': 'application/json' } ) try: response = urllib2.urlopen( url )
diff -r 2ce1ba52c6a7b33676ffebb73053ab3f9e9baa21 -r 24753d36e6a60bb446bd961d16cb4b59abf7b13b test/functional/api/test_jobs.py --- a/test/functional/api/test_jobs.py +++ b/test/functional/api/test_jobs.py @@ -82,8 +82,33 @@ self.__run_cat_tool( history_id, dataset_id ) self._wait_for_history( history_id, assert_ok=True )
+ self.__assert_one_search_result( search_payload ) + + def test_search_param( self ): + history_id, dataset_id = self.__history_with_ok_dataset() + + inputs = json.dumps( + dict( + input=dict( + src='hda', + id=dataset_id, + ), + num_lines=1, + ) + ) + search_payload = dict( + tool_id="random_lines1", + inputs=inputs, + state="ok", + ) + + self.__run_randomlines_tool( 1, history_id, dataset_id ) + self._wait_for_history( history_id, assert_ok=True ) + self.__assert_one_search_result( search_payload ) + + def __assert_one_search_result( self, search_payload ): search_response = self._post( "jobs/search", data=search_payload ) - self._assert_status_code_is( empty_search_response, 200 ) + self._assert_status_code_is( search_response, 200 ) assert len( search_response.json() ) == 1, search_response.json()
def __run_cat_tool( self, history_id, dataset_id ): @@ -100,6 +125,20 @@ ) self._post( "tools", data=payload )
+ def __run_randomlines_tool( self, lines, history_id, dataset_id ): + payload = self._run_tool_payload( + tool_id="random_lines1", + inputs=dict( + num_lines=lines, + input=dict( + src='hda', + id=dataset_id, + ), + ), + history_id=history_id, + ) + self._post( "tools", data=payload ) + def __uploads_with_state( self, *states ): jobs_response = self._get( "jobs", data=dict( state=states ) ) self._assert_status_code_is( jobs_response, 200 )
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