Revert the twilltestcase upload_composite code needed for lped/pbed upload testing

This commit is contained in:
Ross Lazarus
2010-03-10 17:10:43 -05:00
parent 7bc0b33467
commit a6989261b7
3 changed files with 58 additions and 3 deletions
+54
View File
@@ -196,6 +196,60 @@ class TwillTestCase( unittest.TestCase ):
# Wait for upload processing to finish (TODO: this should be done in each test case instead)
self.wait()
def upload_composite_datatype_file( self, ftype, ped_file='', map_file='', bim_file='', bed_file='',
fped_file='',fphe_file='',pphe_file='',fam_file='',pheno_file='',eset_file='',malist_file='',
affybatch_file='', dbkey='unspecified (?)', base_name='rgenetics' ):
"""Tests uploading either of 2 different composite data types ( lped and pbed )"""
self.visit_url( "%s/tool_runner/index?tool_id=upload1" % self.url )
# Handle refresh_on_change
self.refresh_form( "file_type", ftype )
tc.fv( "1", "dbkey", dbkey )
tc.fv( "1", "files_metadata|base_name", base_name )
if ftype == 'lped':
# lped data types include a ped_file and a map_file
ped_file = self.get_filename( ped_file )
tc.formfile( "1", "files_0|file_data", ped_file )
map_file = self.get_filename( map_file )
tc.formfile( "1", "files_1|file_data", map_file )
elif ftype == 'pbed':
# pbed data types include a bim_file, a bed_file and a fam_file
bim_file = self.get_filename( bim_file )
tc.formfile( "1", "files_0|file_data", bim_file )
bed_file = self.get_filename( bed_file )
tc.formfile( "1", "files_1|file_data", bed_file )
fam_file = self.get_filename( fam_file )
tc.formfile( "1", "files_2|file_data", fam_file )
elif ftype == 'pphe':
# pphe data types include a phe_file
pphe_file = self.get_filename( pphe_file )
tc.formfile( "1", "files_0|file_data", pphe_file )
elif ftype == 'fped':
# fped data types include an fped_file only
fped_file = self.get_filename( fped_file )
tc.formfile( "1", "files_0|file_data", fped_file )
elif ftype == 'eset':
# eset data types include a eset_file, a pheno_file
eset_file = self.get_filename( eset_file )
tc.formfile( "1", "files_0|file_data", eset_file )
pheno_file = self.get_filename( pheno_file )
tc.formfile( "1", "files_1|file_data", pheno_file )
elif ftype == 'affybatch':
# affybatch data types include an affybatch_file, and a pheno_file
affybatch_file = self.get_filename( affybatch_file )
tc.formfile( "1", "files_0|file_data", affybatch_file )
pheno_file = self.get_filename( pheno_file )
tc.formfile( "1", "files_1|file_data", pheno_file )
else:
raise AssertionError, "Unsupported composite data type (%s) received, currently only %s data types are supported."\
% (ftype,','.join(self.composite_extensions))
tc.submit( "runtool_btn" )
self.check_page_for_string( 'The following job has been succesfully added to the queue:' )
check_str = base_name #'Uploaded Composite Dataset (%s)' % ftype
self.check_page_for_string( check_str )
# Wait for upload processing to finish (TODO: this should be done in each test case instead)
self.wait()
self.check_history_for_string( check_str )
# Functions associated with histories
def check_history_for_errors( self ):
"""Raises an exception if there are errors in a history"""
+3 -3
View File
@@ -183,7 +183,7 @@ class UploadData( TwillTestCase ):
# We'll test against the resulting ped file and map file for correctness
self.verify_composite_datatype_file_content( 'rgenetics.ped', str( hda.id ) )
self.verify_composite_datatype_file_content( 'rgenetics.map', str( hda.id ) )
self.check_history_for_string( "Uploaded Composite Dataset (lped)" )
self.check_history_for_string( "rgenetics" )
self.delete_history( id=self.security.encode_id( history.id ) )
def test_0060_upload_file( self ):
"""Test uploading pbed composite datatype file, manually setting the file format"""
@@ -205,7 +205,7 @@ class UploadData( TwillTestCase ):
self.verify_composite_datatype_file_content( 'rgenetics.bim', str( hda.id ) )
self.verify_composite_datatype_file_content( 'rgenetics.bed', str( hda.id ) )
self.verify_composite_datatype_file_content( 'rgenetics.fam', str( hda.id ) )
self.check_history_for_string( "Uploaded Composite Dataset (pbed)" )
self.check_history_for_string( "rgenetics" )
self.delete_history( id=self.security.encode_id( history.id ) )
def test_0065_upload_file( self ):
"""Test uploading asian_chars_1.txt, NOT setting the file format"""
@@ -576,4 +576,4 @@ class UploadData( TwillTestCase ):
self.check_history_for_string( 'hello world' )
self.delete_history( id=self.security.encode_id( history.id ) )
def test_9999_clean_up( self ):
self.logout()
self.logout()
+1
View File
@@ -161,3 +161,4 @@ def build_tests():
m.__doc__ = "%s ( %s ) > %s" % ( tool.name, tool.id, testdef.name )
d['test_tool_%06d' % j] = m
G[ n ] = new.classobj( n, s, d )