1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/9e30fa92a4ab/ Changeset: 9e30fa92a4ab User: dan Date: 2013-12-11 15:00:01 Summary: Rename functions to prevent encapsulation / name mangling in test_toolbox.py and test_data_managers.py Affected #: 2 files diff -r 4541fabfeacf4d166d33eb8da6ba7fd638721850 -r 9e30fa92a4ab5531a834a1e9015a4e6d19ef8861 test/functional/test_data_managers.py --- a/test/functional/test_data_managers.py +++ b/test/functional/test_data_managers.py @@ -19,9 +19,9 @@ """ shed_tool_id = self.shed_tool_id - self.__handle_test_def_errors( testdef ) + self._handle_test_def_errors( testdef ) - galaxy_interactor = self.__galaxy_interactor( testdef ) + galaxy_interactor = self._galaxy_interactor( testdef ) test_history = galaxy_interactor.new_history() #history where inputs will be put, if any @@ -41,50 +41,11 @@ self.assertTrue( data_list ) - self.__verify_outputs( testdef, data_manager_history, shed_tool_id, data_list, galaxy_interactor ) + self._verify_outputs( testdef, data_manager_history, shed_tool_id, data_list, galaxy_interactor ) self.switch_history( id=self.security.encode_id( test_history.id ) ) galaxy_interactor.delete_history( test_history ) - - - #Methods below are from test_toolbox.py:ToolTestCase, but are not inherited properly - - def __galaxy_interactor( self, testdef ): - return build_interactor( self, testdef.interactor ) - - def __handle_test_def_errors(self, testdef): - # If the test generation had an error, raise - if testdef.error: - if testdef.exception: - raise testdef.exception - else: - raise Exception( "Test parse failure" ) - - def __verify_outputs( self, testdef, history, shed_tool_id, data_list, galaxy_interactor ): - maxseconds = testdef.maxseconds - - for output_index, output_tuple in enumerate(testdef.outputs): - # Get the correct hid - name, outfile, attributes = output_tuple - try: - output_data = data_list[ name ] - except (TypeError, KeyError): - # Legacy - fall back on ordered data list access if data_list is - # just a list (case with twill variant or if output changes its - # name). - if hasattr(data_list, "values"): - output_data = data_list.values()[ output_index ] - else: - output_data = data_list[ len(data_list) - len(testdef.outputs) + output_index ] - self.assertTrue( output_data is not None ) - try: - galaxy_interactor.verify_output( history, output_data, outfile, attributes=attributes, shed_tool_id=shed_tool_id, maxseconds=maxseconds ) - except Exception: - for stream in ['stdout', 'stderr']: - stream_output = galaxy_interactor.get_job_stream( history, output_data, stream=stream ) - print >>sys.stderr, self._format_stream( stream_output, stream=stream, format=True ) - raise def build_tests( tmp_dir=None, testing_shed_tools=False, master_api_key=None, user_api_key=None ): """ diff -r 4541fabfeacf4d166d33eb8da6ba7fd638721850 -r 9e30fa92a4ab5531a834a1e9015a4e6d19ef8861 test/functional/test_toolbox.py --- a/test/functional/test_toolbox.py +++ b/test/functional/test_toolbox.py @@ -20,9 +20,9 @@ """ shed_tool_id = self.shed_tool_id - self.__handle_test_def_errors( testdef ) + self._handle_test_def_errors( testdef ) - galaxy_interactor = self.__galaxy_interactor( testdef ) + galaxy_interactor = self._galaxy_interactor( testdef ) test_history = galaxy_interactor.new_history() @@ -31,14 +31,14 @@ data_list = galaxy_interactor.run_tool( testdef, test_history ) self.assertTrue( data_list ) - self.__verify_outputs( testdef, test_history, shed_tool_id, data_list, galaxy_interactor ) + self._verify_outputs( testdef, test_history, shed_tool_id, data_list, galaxy_interactor ) galaxy_interactor.delete_history( test_history ) - def __galaxy_interactor( self, testdef ): + def _galaxy_interactor( self, testdef ): return build_interactor( self, testdef.interactor ) - def __handle_test_def_errors(self, testdef): + def _handle_test_def_errors(self, testdef): # If the test generation had an error, raise if testdef.error: if testdef.exception: @@ -46,7 +46,7 @@ else: raise Exception( "Test parse failure" ) - def __verify_outputs( self, testdef, history, shed_tool_id, data_list, galaxy_interactor ): + def _verify_outputs( self, testdef, history, shed_tool_id, data_list, galaxy_interactor ): maxseconds = testdef.maxseconds for output_index, output_tuple in enumerate(testdef.outputs): 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.