Testing framework will now click the add button for nested repeats when repeat content has been specfied.

This commit is contained in:
Daniel Blankenberg
2009-08-05 11:54:34 -04:00
parent e00e64d7cd
commit b1fbae947b
2 changed files with 26 additions and 1 deletions
+9
View File
@@ -650,9 +650,17 @@ class TwillTestCase( unittest.TestCase ):
break
# To help with debugging a tool, print out the form controls when the test fails
print "form '%s' contains the following controls ( note the values )" % f.name
control_names = []
for i, control in enumerate( f.controls ):
print "control %d: %s" % ( i, str( control ) )
try:
#check if a repeat element needs to be added
if control.name not in kwd and control.name.endswith( '_add' ):
#control name doesn't exist, could be repeat
repeat_startswith = control.name[0:-4]
if repeat_startswith and not [ c_name for c_name in control_names if c_name.startswith( repeat_startswith ) ] and [ c_name for c_name in kwd.keys() if c_name.startswith( repeat_startswith ) ]:
tc.submit( control.name )
return self.submit_form( form_no=form_no, button=button, **kwd )
# Check for refresh_on_change attribute, submit a change if required
if 'refresh_on_change' in control.attrs.keys():
changed = False
@@ -677,6 +685,7 @@ class TwillTestCase( unittest.TestCase ):
except Exception, e:
log.debug( "In submit_form, continuing, but caught exception: %s" % str( e ) )
continue
control_names.append( control.name )
# No refresh_on_change attribute found in current form, so process as usual
for control_name, control_value in kwd.items():
if not isinstance( control_value, list ):
+17 -1
View File
@@ -98,7 +98,7 @@ ${simplejson.dumps( __fill_options )}
<param name="fill_empty_columns_switch" value="no_fill"/>
<output name="out_file1" file="joiner_out2.bed"/>
</test>
<test>
<test>
<param name="input1" value="1.bed"/>
<param name="input2" value="2.bed"/>
<param name="field1" value="2"/>
@@ -111,6 +111,22 @@ ${simplejson.dumps( __fill_options )}
<param name="fill_value" value="~"/>
<output name="out_file1" file="joiner_out3.bed"/>
</test>
<test>
<param name="input1" value="1.bed"/>
<param name="input2" value="2.bed"/>
<param name="field1" value="2"/>
<param name="field2" value="2"/>
<param name="unmatched" value="Yes"/>
<param name="partial" value="Yes"/>
<param name="fill_empty_columns_switch" value="fill_empty"/>
<param name="fill_columns_by" value="fill_all"/>
<param name="column_fill_type" value="fill_value_by_column"/>
<param name="column_number1" value="6"/>
<param name="fill_value1" value="+"/>
<param name="column_number2" value="1"/>
<param name="fill_value2" value="NoChrom"/>
<output name="out_file1" file="joiner_out4.bed"/>
</test>
</tests>
<help>