commit/galaxy-central: greg: Fix imports in various functional test scripts.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/786c58661b64/ Changeset: 786c58661b64 User: greg Date: 2013-12-17 17:20:23 Summary: Fix imports in various functional test scripts. Affected #: 5 files diff -r a2bad69f03f4786309ba80ff305ebdd7b68f93fa -r 786c58661b6429a7bcdb0978df1da74dddbd656d test/base/tool_shed_util.py --- a/test/base/tool_shed_util.py +++ b/test/base/tool_shed_util.py @@ -15,6 +15,9 @@ log = logging.getLogger(__name__) +# Set a 10 minute timeout for repository installation. +repository_installation_timeout = 600 + def get_installed_repository_info( elem, last_galaxy_test_file_dir, last_tested_repository_name, last_tested_changeset_revision, tool_path ): """ Return the GALAXY_TEST_FILE_DIR, the containing repository name and the change set revision for the tool elem. diff -r a2bad69f03f4786309ba80ff305ebdd7b68f93fa -r 786c58661b6429a7bcdb0978df1da74dddbd656d test/base/twilltestcase.py --- a/test/base/twilltestcase.py +++ b/test/base/twilltestcase.py @@ -1,39 +1,38 @@ -import pkg_resources -pkg_resources.require( "twill==0.9" ) - +import difflib +import filecmp +import logging +import os +import re +import pprint +import shutil import StringIO -import os -import filecmp +import subprocess +import tarfile +import tempfile import time import unittest import urllib -import logging -import difflib -import tarfile import zipfile -import tempfile -import re -import shutil -import subprocess -import pprint -import twill -import twill.commands as tc -from twill.other_packages._mechanize_dist import ClientForm -pkg_resources.require( "elementtree" ) -pkg_resources.require( "MarkupSafe" ) -from markupsafe import escape -from elementtree import ElementTree from galaxy.web import security from galaxy.web.framework.helpers import iff from galaxy.util.json import from_json_string from base.asserts import verify_assertions -buffer = StringIO.StringIO() +from galaxy import eggs +eggs.require( "elementtree" ) +eggs.require( 'twill' ) + +from elementtree import ElementTree + +import twill +import twill.commands as tc +from twill.other_packages._mechanize_dist import ClientForm #Force twill to log to a buffer -- FIXME: Should this go to stdout and be captured by nose? -twill.set_output(buffer) -tc.config('use_tidy', 0) +buffer = StringIO.StringIO() +twill.set_output( buffer ) +tc.config( 'use_tidy', 0 ) # Dial ClientCookie logging down (very noisy) logging.getLogger( "ClientCookie.cookies" ).setLevel( logging.WARNING ) diff -r a2bad69f03f4786309ba80ff305ebdd7b68f93fa -r 786c58661b6429a7bcdb0978df1da74dddbd656d test/install_and_test_tool_shed_repositories/base/twilltestcase.py --- a/test/install_and_test_tool_shed_repositories/base/twilltestcase.py +++ b/test/install_and_test_tool_shed_repositories/base/twilltestcase.py @@ -1,9 +1,22 @@ +import logging +import os +import re +import test_db_util +import time +import urllib + import galaxy.model as model import galaxy.model.tool_shed_install as install_model -import common, string, os, re, test_db_util, simplejson, logging, time, sys -import galaxy.util as util -from base.twilltestcase import tc, from_json_string, TwillTestCase, security, urllib -from tool_shed.util.encoding_util import tool_shed_encode, tool_shed_decode +import galaxy.util + +from galaxy.web import security +from base.twilltestcase import TwillTestCase +from base.tool_shed_util import repository_installation_timeout + +from galaxy import eggs +eggs.require( 'twill' ) + +import twill.commands as tc log = logging.getLogger( __name__ ) @@ -52,7 +65,7 @@ if install_parameters: iri_ids = install_parameters.group(1) # In some cases, the returned iri_ids are of the form: "[u'<encoded id>', u'<encoded id>']" - # This regex ensures that non-hex characters are stripped out of the list, so that util.listify/decode_id + # This regex ensures that non-hex characters are stripped out of the list, so that galaxy.util.listify/decode_id # will handle them correctly. It's safe to pass the cleaned list to manage_repositories, because it can parse # comma-separated values. repository_ids = str( iri_ids ) @@ -60,9 +73,9 @@ encoded_kwd = install_parameters.group(2) reinstalling = install_parameters.group(3) url = '/admin_toolshed/manage_repositories?operation=install&tool_shed_repository_ids=%s&encoded_kwd=%s&reinstalling=%s' % \ - ( ','.join( util.listify( repository_ids ) ), encoded_kwd, reinstalling ) + ( ','.join( galaxy.util.listify( repository_ids ) ), encoded_kwd, reinstalling ) self.visit_url( url ) - return util.listify( repository_ids ) + return galaxy.util.listify( repository_ids ) def install_repository( self, repository_info_dict, install_tool_dependencies=True, install_repository_dependencies=True, strings_displayed=[], strings_not_displayed=[], preview_strings_displayed=[], @@ -161,9 +174,9 @@ timeout_counter = timeout_counter + 1 if timeout_counter % 10 == 0: log.debug( 'Waited %d seconds for repository %s.' % ( timeout_counter, str( galaxy_repository.name ) ) ) - # This timeout currently defaults to 180 seconds, or 3 minutes. - if timeout_counter > common.repository_installation_timeout: - raise AssertionError( 'Repository installation timed out, %d seconds elapsed, repository state is %s.' % \ - ( timeout_counter, repository.status ) ) + # This timeout currently defaults to 10 minutes. + if timeout_counter > repository_installation_timeout: + raise AssertionError( 'Repository installation timed out after %d seconds, repository state is %s.' % \ + ( timeout_counter, repository.status ) ) break time.sleep( 1 ) diff -r a2bad69f03f4786309ba80ff305ebdd7b68f93fa -r 786c58661b6429a7bcdb0978df1da74dddbd656d test/tool_shed/base/common.py --- a/test/tool_shed/base/common.py +++ b/test/tool_shed/base/common.py @@ -33,6 +33,3 @@ ''' new_repository_dependencies_line = ''' <repository toolshed="${toolshed_url}" name="${repository_name}" owner="${owner}" changeset_revision="${changeset_revision}"${prior_installation_required} />''' - -# Set a 3 minute timeout for repository installation. This should be sufficient, since we're not installing tool dependencies. -repository_installation_timeout = 180 \ No newline at end of file diff -r a2bad69f03f4786309ba80ff305ebdd7b68f93fa -r 786c58661b6429a7bcdb0978df1da74dddbd656d test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -12,16 +12,27 @@ import urllib import galaxy.webapps.tool_shed.util.hgweb_config import galaxy.model.tool_shed_install as galaxy_model -import galaxy.util as util +import galaxy.util + +from base.tool_shed_util import repository_installation_timeout +from base.twilltestcase import TwillTestCase +from galaxy.util.json import from_json_string +from galaxy.web import security +from tool_shed.util.encoding_util import tool_shed_encode from tool_shed.util import shed_util_common as suc from tool_shed.util import xml_util -from base.twilltestcase import tc, from_json_string, TwillTestCase, security, urllib -from tool_shed.util.encoding_util import tool_shed_encode, tool_shed_decode from galaxy import eggs -eggs.require('mercurial') -from mercurial import hg, ui, commands +eggs.require( 'mercurial' ) +eggs.require( 'twill' ) + from mercurial.util import Abort +from mercurial import commands +from mercurial import hg +from mercurial import ui + +import twill.commands as tc + log = logging.getLogger( __name__ ) @@ -848,7 +859,7 @@ if install_parameters: iri_ids = install_parameters.group(1) # In some cases, the returned iri_ids are of the form: "[u'<encoded id>', u'<encoded id>']" - # This regex ensures that non-hex characters are stripped out of the list, so that util.listify/decode_id + # This regex ensures that non-hex characters are stripped out of the list, so that galaxy.util.listify/decode_id # will handle them correctly. It's safe to pass the cleaned list to manage_repositories, because it can parse # comma-separated values. repository_ids = str( iri_ids ) @@ -856,9 +867,9 @@ encoded_kwd = install_parameters.group(2) reinstalling = install_parameters.group(3) url = '/admin_toolshed/manage_repositories?operation=install&tool_shed_repository_ids=%s&encoded_kwd=%s&reinstalling=%s' % \ - ( ','.join( util.listify( repository_ids ) ), encoded_kwd, reinstalling ) + ( ','.join( galaxy.util.listify( repository_ids ) ), encoded_kwd, reinstalling ) self.visit_galaxy_url( url ) - return util.listify( repository_ids ) + return galaxy.util.listify( repository_ids ) def install_repositories_from_search_results( self, repositories, install_tool_dependencies=False, strings_displayed=[], strings_not_displayed=[], **kwd ): @@ -1327,7 +1338,7 @@ def verify_installed_repository_data_table_entries( self, required_data_table_entries ): # The value of the received required_data_table_entries will be something like: [ 'sam_fa_indexes' ] - data_tables = util.parse_xml( self.shed_tool_data_table_conf ) + data_tables = xml_util.parse_xml( self.shed_tool_data_table_conf ) found = False # With the tool shed, the "path" attribute that is hard-coded into the tool_data_tble_conf.xml # file is ignored. This is because the tool shed requires the directory location to which this @@ -1445,8 +1456,8 @@ while galaxy_repository.status not in final_states: test_db_util.ga_refresh( galaxy_repository ) timeout_counter = timeout_counter + 1 - # This timeout currently defaults to 180 seconds, or 3 minutes. - if timeout_counter > common.repository_installation_timeout: + # This timeout currently defaults to 10 minutes. + if timeout_counter > repository_installation_timeout: raise AssertionError( 'Repository installation timed out, %d seconds elapsed, repository state is %s.' % \ ( timeout_counter, galaxy_repository.status ) ) break 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.
participants (1)
-
commits-noreply@bitbucket.org