mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
... tweaked styling of several functional tests (the non-toolbox,datamanager,workflow,api functional tests) along the way - mostly PEP-8 fixes and eliminating * imports. Did not modify tests which do not pass - but did not in the source where they fail inside a TODO.
40 lines
2.1 KiB
Python
40 lines
2.1 KiB
Python
from base.twilltestcase import TwillTestCase
|
|
import base.test_db_util as test_db_util
|
|
|
|
|
|
class TestDatasetFeatures( TwillTestCase ):
|
|
|
|
def test_0000_initiate_users( self ):
|
|
"""Ensuring all required user accounts exist"""
|
|
self.logout()
|
|
self.login( email='test@bx.psu.edu', username='admin-user' )
|
|
global admin_user
|
|
admin_user = test_db_util.get_user( 'test@bx.psu.edu' )
|
|
assert admin_user is not None, 'Problem retrieving user with email "test@bx.psu.edu" from the database'
|
|
global admin_user_private_role
|
|
admin_user_private_role = test_db_util.get_private_role( admin_user )
|
|
latest_history = test_db_util.get_latest_history_for_user( admin_user )
|
|
self.delete_history( id=self.security.encode_id( latest_history.id ) )
|
|
self.new_history()
|
|
latest_history = test_db_util.get_latest_history_for_user( admin_user )
|
|
assert latest_history is not None, "Problem retrieving latest_history from database"
|
|
|
|
def test_0005_initiate_data( self ):
|
|
'''Ensure that data exists for this test suite.'''
|
|
self.upload_file( '1.bed' )
|
|
|
|
def test_0010_view_dataset_params( self ):
|
|
'''Test viewing a dataset's parameters.'''
|
|
hda = self.find_hda_by_dataset_name( '1.bed' )
|
|
assert hda is not None, 'Could not retrieve latest hda from history API.'
|
|
self.visit_url( '/datasets/%s/show_params' % hda[ 'id'] )
|
|
self.check_for_strings( strings_displayed=[ '1.bed', 'uploaded' ] )
|
|
|
|
def test_0015_report_dataset_error( self ):
|
|
'''Load and submit the report error form. This should show an error message, as the functional test instance should not be configured for email.'''
|
|
hda = test_db_util.get_latest_hda()
|
|
self.visit_url( '/dataset/errors?id=%s' % self.security.encode_id( hda.hid ) )
|
|
self.check_for_strings( strings_displayed=[ 'Report this error', 'Your email' ] )
|
|
self.submit_form( button='submit_error_report', email='test@bx.psu.edu', message='This tool completed successfully, disregard.' )
|
|
self.check_for_strings( strings_displayed=[ 'Mail is not configured' ] )
|