[hg] galaxy 2879: Add new functional tests for uploading composi...
details: http://www.bx.psu.edu/hg/galaxy/rev/39c1d12c2e7d changeset: 2879:39c1d12c2e7d user: Greg Von Kuster <greg@bx.psu.edu> date: Tue Oct 13 16:37:20 2009 -0400 description: Add new functional tests for uploading composite data types lped and pbed - handles ticket # 173. 11 file(s) affected in this change: datatypes_conf.xml.sample test-data/rgenetics.bed test-data/rgenetics.bim test-data/rgenetics.fam test-data/tinywga.bed test-data/tinywga.bim test-data/tinywga.fam test-data/tinywga.map test-data/tinywga.ped test/base/twilltestcase.py test/functional/test_get_data.py diffs (504 lines): diff -r 286958ef8157 -r 39c1d12c2e7d datatypes_conf.xml.sample --- a/datatypes_conf.xml.sample Tue Oct 13 16:18:16 2009 -0400 +++ b/datatypes_conf.xml.sample Tue Oct 13 16:37:20 2009 -0400 @@ -162,9 +162,9 @@ <datatype extension="gg" type="galaxy.datatypes.genetics:GenomeGraphs"/> <datatype extension="rgenetics" type="galaxy.datatypes.genetics:Rgenetics"/> <!-- linkage format pedigree (separate .map file) --> - <datatype extension="lped" type="galaxy.datatypes.genetics:Lped"/> + <datatype extension="lped" type="galaxy.datatypes.genetics:Lped" display_in_upload="true"/> <!-- plink compressed file - has bed extension unfortunately --> - <datatype extension="pbed" type="galaxy.datatypes.genetics:Pbed"/> + <datatype extension="pbed" type="galaxy.datatypes.genetics:Pbed" display_in_upload="true"/> <!-- eigenstrat pedigree input file --> <datatype extension="eigenstratgeno" type="galaxy.datatypes.genetics:Eigenstratgeno"/> <!-- eigenstrat pca output file for adjusted eigenQTL eg --> diff -r 286958ef8157 -r 39c1d12c2e7d test-data/rgenetics.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/rgenetics.bed Tue Oct 13 16:37:20 2009 -0400 @@ -0,0 +1,1 @@ +lÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿïŸîžÿÿüþ¿ÿ¿ûú¿¿ï/ÿÿþÿï¯êžëê°®Ÿî®ãêž;ì/âïú¯ï¯ÎêŒïâ°¯þϪã¯ø+ì?âÿú¯ïëÿîŸÿºþÿþ¯þï¿ÿ;ï?þÿÿÿïÿÿÿÿÿºÿÿþ¯þï¿ÿ»ÿÿþÿÿÿïëÿîŸÿºþÿþ¯þï¿ÿ;ï?þÿÿÿÿÿÿÿþïÿÿÿþÿÿÿÿûÿûÿÿÿ»ÿïëÿîŸÿºþÿþ¯þï¿ÿ;ï?þÿÿÿïëÿêŸÿºúïþ¯îë¿þ;¯>âïþ» \ No newline at end of file diff -r 286958ef8157 -r 39c1d12c2e7d test-data/rgenetics.bim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/rgenetics.bim Tue Oct 13 16:37:20 2009 -0400 @@ -0,0 +1,10 @@ +22 rs5992809 16.5965 16596539 0 C +22 rs12168131 16.6573 16657262 G A +22 rs390041 16.6629 16662916 T C +22 rs437633 16.6697 16669684 A G +22 rs450960 16.6909 16690858 T C +22 rs450975 16.6909 16690887 T C +22 rs451740 16.6912 16691174 T C +22 rs8139723 16.6917 16691696 T C +22 rs405490 16.6922 16692175 G A +22 rs415170 16.6935 16693517 G C diff -r 286958ef8157 -r 39c1d12c2e7d test-data/rgenetics.fam --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/rgenetics.fam Tue Oct 13 16:37:20 2009 -0400 @@ -0,0 +1,90 @@ +CH18526 NA18526 0 0 2 1 +CH18524 NA18524 0 0 1 1 +CH18529 NA18529 0 0 2 1 +CH18558 NA18558 0 0 1 1 +CH18532 NA18532 0 0 2 1 +CH18561 NA18561 0 0 1 1 +CH18562 NA18562 0 0 1 1 +CH18537 NA18537 0 0 2 2 +CH18603 NA18603 0 0 1 2 +CH18540 NA18540 0 0 2 1 +CH18605 NA18605 0 0 1 1 +CH18542 NA18542 0 0 2 1 +CH18545 NA18545 0 0 2 1 +CH18572 NA18572 0 0 1 2 +CH18547 NA18547 0 0 2 2 +CH18609 NA18609 0 0 1 1 +CH18550 NA18550 0 0 2 1 +CH18608 NA18608 0 0 1 1 +CH18552 NA18552 0 0 2 1 +CH18611 NA18611 0 0 1 1 +CH18555 NA18555 0 0 2 1 +CH18564 NA18564 0 0 2 2 +CH18566 NA18566 0 0 2 1 +CH18563 NA18563 0 0 1 1 +CH18570 NA18570 0 0 2 1 +CH18612 NA18612 0 0 1 2 +CH18571 NA18571 0 0 2 1 +CH18620 NA18620 0 0 1 1 +CH18621 NA18621 0 0 1 1 +CH18594 NA18594 0 0 2 1 +CH18622 NA18622 0 0 1 2 +CH18573 NA18573 0 0 2 2 +CH18623 NA18623 0 0 1 1 +CH18576 NA18576 0 0 2 1 +CH18577 NA18577 0 0 2 1 +CH18624 NA18624 0 0 1 1 +CH18579 NA18579 0 0 2 1 +CH18632 NA18632 0 0 1 2 +CH18582 NA18582 0 0 2 1 +CH18633 NA18633 0 0 1 1 +CH18635 NA18635 0 0 1 2 +CH18592 NA18592 0 0 2 1 +CH18636 NA18636 0 0 1 1 +CH18593 NA18593 0 0 2 2 +CH18637 NA18637 0 0 1 1 +JA18942 NA18942 0 0 2 2 +JA18940 NA18940 0 0 1 2 +JA18951 NA18951 0 0 2 2 +JA18943 NA18943 0 0 1 2 +JA18947 NA18947 0 0 2 2 +JA18944 NA18944 0 0 1 2 +JA18945 NA18945 0 0 1 2 +JA18949 NA18949 0 0 2 2 +JA18948 NA18948 0 0 1 2 +JA18952 NA18952 0 0 1 2 +JA18956 NA18956 0 0 2 2 +JA18964 NA18964 0 0 2 2 +JA18953 NA18953 0 0 1 1 +JA18968 NA18968 0 0 2 2 +JA18959 NA18959 0 0 1 2 +JA18969 NA18969 0 0 2 1 +JA18960 NA18960 0 0 1 2 +JA18961 NA18961 0 0 1 2 +JA18972 NA18972 0 0 2 2 +JA18965 NA18965 0 0 1 2 +JA18973 NA18973 0 0 2 2 +JA18966 NA18966 0 0 1 2 +JA18975 NA18975 0 0 2 2 +JA18967 NA18967 0 0 1 2 +JA18976 NA18976 0 0 2 1 +JA18978 NA18978 0 0 2 2 +JA18970 NA18970 0 0 1 1 +JA18980 NA18980 0 0 2 2 +JA18995 NA18995 0 0 1 1 +JA18981 NA18981 0 0 2 2 +JA18971 NA18971 0 0 1 2 +JA18974 NA18974 0 0 1 1 +JA18987 NA18987 0 0 2 2 +JA18990 NA18990 0 0 1 1 +JA18991 NA18991 0 0 2 2 +JA18994 NA18994 0 0 1 2 +JA18992 NA18992 0 0 2 2 +JA18997 NA18997 0 0 2 2 +JA18998 NA18998 0 0 2 2 +JA19000 NA19000 0 0 1 2 +JA19005 NA19005 0 0 1 2 +JA18999 NA18999 0 0 2 2 +JA19007 NA19007 0 0 1 2 +JA19003 NA19003 0 0 2 2 +JA19012 NA19012 0 0 1 2 diff -r 286958ef8157 -r 39c1d12c2e7d test-data/tinywga.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/tinywga.bed Tue Oct 13 16:37:20 2009 -0400 @@ -0,0 +1,1 @@ +lÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿïŸîžÿÿüþ¿ÿ¿ûú¿¿ï/ÿÿþÿï¯êžëê°®Ÿî®ãêž;ì/âïú¯ï¯ÎêŒïâ°¯þϪã¯ø+ì?âÿú¯ïëÿîŸÿºþÿþ¯þï¿ÿ;ï?þÿÿÿïÿÿÿÿÿºÿÿþ¯þï¿ÿ»ÿÿþÿÿÿïëÿîŸÿºþÿþ¯þï¿ÿ;ï?þÿÿÿÿÿÿÿþïÿÿÿþÿÿÿÿûÿûÿÿÿ»ÿïëÿîŸÿºþÿþ¯þï¿ÿ;ï?þÿÿÿïëÿêŸÿºúïþ¯îë¿þ;¯>âïþ» \ No newline at end of file diff -r 286958ef8157 -r 39c1d12c2e7d test-data/tinywga.bim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/tinywga.bim Tue Oct 13 16:37:20 2009 -0400 @@ -0,0 +1,10 @@ +22 rs5992809 16.5965 16596539 0 C +22 rs12168131 16.6573 16657262 G A +22 rs390041 16.6629 16662916 T C +22 rs437633 16.6697 16669684 A G +22 rs450960 16.6909 16690858 T C +22 rs450975 16.6909 16690887 T C +22 rs451740 16.6912 16691174 T C +22 rs8139723 16.6917 16691696 T C +22 rs405490 16.6922 16692175 G A +22 rs415170 16.6935 16693517 G C diff -r 286958ef8157 -r 39c1d12c2e7d test-data/tinywga.fam --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/tinywga.fam Tue Oct 13 16:37:20 2009 -0400 @@ -0,0 +1,90 @@ +CH18526 NA18526 0 0 2 1 +CH18524 NA18524 0 0 1 1 +CH18529 NA18529 0 0 2 1 +CH18558 NA18558 0 0 1 1 +CH18532 NA18532 0 0 2 1 +CH18561 NA18561 0 0 1 1 +CH18562 NA18562 0 0 1 1 +CH18537 NA18537 0 0 2 2 +CH18603 NA18603 0 0 1 2 +CH18540 NA18540 0 0 2 1 +CH18605 NA18605 0 0 1 1 +CH18542 NA18542 0 0 2 1 +CH18545 NA18545 0 0 2 1 +CH18572 NA18572 0 0 1 2 +CH18547 NA18547 0 0 2 2 +CH18609 NA18609 0 0 1 1 +CH18550 NA18550 0 0 2 1 +CH18608 NA18608 0 0 1 1 +CH18552 NA18552 0 0 2 1 +CH18611 NA18611 0 0 1 1 +CH18555 NA18555 0 0 2 1 +CH18564 NA18564 0 0 2 2 +CH18566 NA18566 0 0 2 1 +CH18563 NA18563 0 0 1 1 +CH18570 NA18570 0 0 2 1 +CH18612 NA18612 0 0 1 2 +CH18571 NA18571 0 0 2 1 +CH18620 NA18620 0 0 1 1 +CH18621 NA18621 0 0 1 1 +CH18594 NA18594 0 0 2 1 +CH18622 NA18622 0 0 1 2 +CH18573 NA18573 0 0 2 2 +CH18623 NA18623 0 0 1 1 +CH18576 NA18576 0 0 2 1 +CH18577 NA18577 0 0 2 1 +CH18624 NA18624 0 0 1 1 +CH18579 NA18579 0 0 2 1 +CH18632 NA18632 0 0 1 2 +CH18582 NA18582 0 0 2 1 +CH18633 NA18633 0 0 1 1 +CH18635 NA18635 0 0 1 2 +CH18592 NA18592 0 0 2 1 +CH18636 NA18636 0 0 1 1 +CH18593 NA18593 0 0 2 2 +CH18637 NA18637 0 0 1 1 +JA18942 NA18942 0 0 2 2 +JA18940 NA18940 0 0 1 2 +JA18951 NA18951 0 0 2 2 +JA18943 NA18943 0 0 1 2 +JA18947 NA18947 0 0 2 2 +JA18944 NA18944 0 0 1 2 +JA18945 NA18945 0 0 1 2 +JA18949 NA18949 0 0 2 2 +JA18948 NA18948 0 0 1 2 +JA18952 NA18952 0 0 1 2 +JA18956 NA18956 0 0 2 2 +JA18964 NA18964 0 0 2 2 +JA18953 NA18953 0 0 1 1 +JA18968 NA18968 0 0 2 2 +JA18959 NA18959 0 0 1 2 +JA18969 NA18969 0 0 2 1 +JA18960 NA18960 0 0 1 2 +JA18961 NA18961 0 0 1 2 +JA18972 NA18972 0 0 2 2 +JA18965 NA18965 0 0 1 2 +JA18973 NA18973 0 0 2 2 +JA18966 NA18966 0 0 1 2 +JA18975 NA18975 0 0 2 2 +JA18967 NA18967 0 0 1 2 +JA18976 NA18976 0 0 2 1 +JA18978 NA18978 0 0 2 2 +JA18970 NA18970 0 0 1 1 +JA18980 NA18980 0 0 2 2 +JA18995 NA18995 0 0 1 1 +JA18981 NA18981 0 0 2 2 +JA18971 NA18971 0 0 1 2 +JA18974 NA18974 0 0 1 1 +JA18987 NA18987 0 0 2 2 +JA18990 NA18990 0 0 1 1 +JA18991 NA18991 0 0 2 2 +JA18994 NA18994 0 0 1 2 +JA18992 NA18992 0 0 2 2 +JA18997 NA18997 0 0 2 2 +JA18998 NA18998 0 0 2 2 +JA19000 NA19000 0 0 1 2 +JA19005 NA19005 0 0 1 2 +JA18999 NA18999 0 0 2 2 +JA19007 NA19007 0 0 1 2 +JA19003 NA19003 0 0 2 2 +JA19012 NA19012 0 0 1 2 diff -r 286958ef8157 -r 39c1d12c2e7d test-data/tinywga.map --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/tinywga.map Tue Oct 13 16:37:20 2009 -0400 @@ -0,0 +1,10 @@ +22 rs5992809 16.5965 16596539 +22 rs12168131 16.6573 16657262 +22 rs390041 16.6629 16662916 +22 rs437633 16.6697 16669684 +22 rs450960 16.6909 16690858 +22 rs450975 16.6909 16690887 +22 rs451740 16.6912 16691174 +22 rs8139723 16.6917 16691696 +22 rs405490 16.6922 16692175 +22 rs415170 16.6935 16693517 diff -r 286958ef8157 -r 39c1d12c2e7d test-data/tinywga.ped --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/tinywga.ped Tue Oct 13 16:37:20 2009 -0400 @@ -0,0 +1,90 @@ +CH18526 NA18526 0 0 2 1 C C A A C C G G C C C C C C C C A A C C +CH18524 NA18524 0 0 1 1 C C A A C C G G C C C C C C C C A A C C +CH18529 NA18529 0 0 2 1 C C A A T C A G T C T C T C C C G A G C +CH18558 NA18558 0 0 1 1 C C A A C C G G C C C C C C C C A A C C +CH18532 NA18532 0 0 2 1 C C A A C C G G C C C C C C C C A A C C +CH18561 NA18561 0 0 1 1 C C A A C C G G T C C C T C C C G A G C +CH18562 NA18562 0 0 1 1 C C G A T C A G T C C C T C C C G A G C +CH18537 NA18537 0 0 2 2 C C A A T C A G C C C C C C C C A A C C +CH18603 NA18603 0 0 1 2 C C G A T C A G C C C C C C C C A A C C +CH18540 NA18540 0 0 2 1 C C A A C C G G C C C C C C C C A A C C +CH18605 NA18605 0 0 1 1 C C A A T T A A C C C C C C C C A A C C +CH18542 NA18542 0 0 2 1 C C G A T C G G C C C C C C C C A A C C +CH18545 NA18545 0 0 2 1 C C G A T C A G T C C C T C C C G A G C +CH18572 NA18572 0 0 1 2 C C A A T C A G C C C C C C C C A A G C +CH18547 NA18547 0 0 2 2 C C G A T C A G T C C C T C C C G A G C +CH18609 NA18609 0 0 1 1 C C A A C C G G C C C C C C C C A A C C +CH18550 NA18550 0 0 2 1 C C G G T T A A T C C C T C T C G A G C +CH18608 NA18608 0 0 1 1 C C G A T C G G C C C C C C C C A A C C +CH18552 NA18552 0 0 2 1 C C A A C C G G C C C C C C C C A A C C +CH18611 NA18611 0 0 1 1 C C G A T C A G T C C C T C C C G A G C +CH18555 NA18555 0 0 2 1 C C A A C C G G C C C C C C C C A A C C +CH18564 NA18564 0 0 2 2 C C A A T C G G C C C C C C C C A A C C +CH18566 NA18566 0 0 2 1 C C A A T C A G C C C C C C T C A A C C +CH18563 NA18563 0 0 1 1 C C A A C C G G C C C C C C C C A A C C +CH18570 NA18570 0 0 2 1 C C A A T C A G T C T C T C C C G A G C +CH18612 NA18612 0 0 1 2 C C A A T C A A T C T C T C C C G A G C +CH18571 NA18571 0 0 2 1 C C A A T C A G C C C C C C C C A A C C +CH18620 NA18620 0 0 1 1 C C A A C C G G T C T C T C C C G A G C +CH18621 NA18621 0 0 1 1 C C G G T T A A T C C C T C C C G A G C +CH18594 NA18594 0 0 2 1 C C A A T T A A C C C C C C C C A A G C +CH18622 NA18622 0 0 1 2 C C A A C C G G C C C C C C C C A A C C +CH18573 NA18573 0 0 2 2 C C A A T C A G C C C C C C C C A A C C +CH18623 NA18623 0 0 1 1 C C G A T C G G C C C C C C C C A A C C +CH18576 NA18576 0 0 2 1 C C A A C C G G C C C C C C C C A A C C +CH18577 NA18577 0 0 2 1 C C A A T C A G C C C C C C C C A A G C +CH18624 NA18624 0 0 1 1 C C A A T C A G C C C C C C C C A A C C +CH18579 NA18579 0 0 2 1 C C A A T C A G T C T C T C T C G A G C +CH18632 NA18632 0 0 1 2 C C A A C C G G C C C C C C C C A A C C +CH18582 NA18582 0 0 2 1 C C A A C C G G C C C C C C C C A A C C +CH18633 NA18633 0 0 1 1 C C G A T C G G C C C C C C C C A A C C +CH18635 NA18635 0 0 1 2 C C A A T C G G C C C C C C C C A A C C +CH18592 NA18592 0 0 2 1 C C A A C C G G C C C C C C C C A A C C +CH18636 NA18636 0 0 1 1 C C A A T C A A T C T C T C C C G A G C +CH18593 NA18593 0 0 2 2 C C A A C C G G T C T C T C C C G A G C +CH18637 NA18637 0 0 1 1 C C A A T C A G T C T C T C C C G A G C +JA18942 NA18942 0 0 2 2 C C A A C C A G C C C C C C C C A A C C +JA18940 NA18940 0 0 1 2 C C A A T C A G C C C C C C C C A A G C +JA18951 NA18951 0 0 2 2 C C G A T C A G C C C C C C C C A A C C +JA18943 NA18943 0 0 1 2 C C A A C C G G C C C C C C C C A A C C +JA18947 NA18947 0 0 2 2 C C G A T T A A C C C C C C C C A A G C +JA18944 NA18944 0 0 1 2 C C A A T C A G T C T C T C C C G A G C +JA18945 NA18945 0 0 1 2 C C A A C C G G C C C C C C C C A A C C +JA18949 NA18949 0 0 2 2 C C G A T C G G C C C C C C C C A A C C +JA18948 NA18948 0 0 1 2 C C G A T C G G C C C C C C C C A A C C +JA18952 NA18952 0 0 1 2 C C A A T C A G C C C C C C C C A A C C +JA18956 NA18956 0 0 2 2 C C A A C C A G T C T C T C C C G A G C +JA18964 NA18964 0 0 2 2 C C A A T T A A C C C C C C C C A A G C +JA18953 NA18953 0 0 1 1 C C A A T C A G C C C C C C T C A A C C +JA18968 NA18968 0 0 2 2 C C A A C C G G C C C C C C C C A A C C +JA18959 NA18959 0 0 1 2 C C G A T C G G C C C C C C C C A A C C +JA18969 NA18969 0 0 2 1 C C A A C C G G C C C C C C C C A A C C +JA18960 NA18960 0 0 1 2 C C A A T C A G T C T C T C C C G A G C +JA18961 NA18961 0 0 1 2 C C A A C C A G C C C C C C C C A A C C +JA18972 NA18972 0 0 2 2 C C G A T T A A T T T C T T C C G G G G +JA18965 NA18965 0 0 1 2 C C A A T T A A C C C C C C C C A A C C +JA18973 NA18973 0 0 2 2 C C A A C C G G C C C C C C T C A A C C +JA18966 NA18966 0 0 1 2 C C G A T C A G T C C C T C C C G A G C +JA18975 NA18975 0 0 2 2 C C A A C C G G C C C C C C C C A A G C +JA18967 NA18967 0 0 1 2 C C A A C C G G C C C C C C C C A A G C +JA18976 NA18976 0 0 2 1 C C A A C C G G C C C C C C C C A A C C +JA18978 NA18978 0 0 2 2 C C G A T C G G C C C C C C C C A A C C +JA18970 NA18970 0 0 1 1 C C G G T T A A T T C C T T C C G G G G +JA18980 NA18980 0 0 2 2 C C A A T C A G T C T C T C C C G A G C +JA18995 NA18995 0 0 1 1 C C A A T T A A C C C C C C C C A A G G +JA18981 NA18981 0 0 2 2 C C A A T C A G C C C C C C C C A A G C +JA18971 NA18971 0 0 1 2 C C A A C C G G C C C C C C C C A A C C +JA18974 NA18974 0 0 1 1 C C A A C C G G C C C C C C C C A A C C +JA18987 NA18987 0 0 2 2 C C A A C C G G C C C C C C C C A A C C +JA18990 NA18990 0 0 1 1 C C A A T C G G C C C C C C C C A A G C +JA18991 NA18991 0 0 2 2 C C A A C C G G C C C C C C C C A A C C +JA18994 NA18994 0 0 1 2 C C G A T C A G C C C C C C C C A A G C +JA18992 NA18992 0 0 2 2 C C A A T C A G C C C C C C T C A A C C +JA18997 NA18997 0 0 2 2 C C A A C C G G C C C C C C C C A A C C +JA18998 NA18998 0 0 2 2 C C A A C C G G C C C C C C T C A A C C +JA19000 NA19000 0 0 1 2 C C A A C C G G C C C C C C C C A A C C +JA19005 NA19005 0 0 1 2 C C A A C C G G C C C C C C C C A A G C +JA18999 NA18999 0 0 2 2 C C A A T C A G C C C C C C C C A A C C +JA19007 NA19007 0 0 1 2 C C A A T C A G C C C C C C C C A A G C +JA19003 NA19003 0 0 2 2 C C A A T C G G C C C C C C C C A A C C +JA19012 NA19012 0 0 1 2 C C A A 0 0 G G C C C C C C 0 0 A A C C diff -r 286958ef8157 -r 39c1d12c2e7d test/base/twilltestcase.py --- a/test/base/twilltestcase.py Tue Oct 13 16:18:16 2009 -0400 +++ b/test/base/twilltestcase.py Tue Oct 13 16:37:20 2009 -0400 @@ -83,7 +83,7 @@ tc.submit("runtool_btn") self.home() except AssertionError, err: - errmsg = "The file (%s) doesn't exist." % filename + errmsg = "Uploading file resulted in the following exception. Make sure the file (%s) exists. " % filename errmsg += str( err ) raise AssertionError( errmsg ) # Make sure every history item has a valid hid @@ -116,7 +116,36 @@ raise AssertionError, "Invalid hid (%s) created when pasting %s" % ( hid, url_paste ) # 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='', fam_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 ) + else: + raise AssertionError, "Unsupported composite data type (%s) received, currently only lped and pbed data types are supported." % ftype + tc.submit( "runtool_btn" ) + self.check_page_for_string( 'The following job has been succesfully added to the queue:' ) + check_str = '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""" @@ -522,7 +551,20 @@ errmsg += str( err ) raise AssertionError( errmsg ) os.remove(temp_name) - + def verify_composite_datatype_file_content( self, file_name, hda_id ): + local_name = self.get_filename( file_name ) + temp_name = self.get_filename( 'temp_%s' % file_name ) + self.visit_url( "%s/datasets/%s/display/%s" % ( self.url, hda_id, file_name ) ) + data = self.last_page() + file( temp_name, 'wb' ).write( data ) + try: + self.files_diff( local_name, temp_name ) + except AssertionError, err: + os.remove( temp_name ) + errmsg = 'History item %s different than expected, difference:\n' % str( hda_id ) + errmsg += str( err ) + raise AssertionError( errmsg ) + os.remove( temp_name ) def is_zipped( self, filename ): if not zipfile.is_zipfile( filename ): return False @@ -722,7 +764,29 @@ # Add conditions for other control types here when necessary. pass tc.submit( button ) - + def refresh_form( self, control_name, value, form_no=0, **kwd ): + """Handles Galaxy's refresh_on_change for forms without ultimately submitting the form""" + # control_name is the name of the form field that requires refresh_on_change, and value is + # the value to which that field is being set. + for i, f in enumerate( self.showforms() ): + if i == form_no: + break + try: + control = f.find_control( name=control_name ) + except: + # This assumes we always want the first control of the given name, which may not be ideal... + control = f.find_control( name=control_name, nr=0 ) + # Check for refresh_on_change attribute, submit a change if required + if 'refresh_on_change' in control.attrs.keys(): + # Clear Control and set to proper value + control.clear() + tc.fv( f.name, control.name, value ) + # Create a new submit control, allows form to refresh, instead of going to next page + control = ClientForm.SubmitControl( 'SubmitControl', '___refresh_grouping___', {'name':'refresh_grouping'} ) + control.add_to_form( f ) + control.fixup() + # Submit for refresh + tc.submit( '___refresh_grouping___' ) def visit_page( self, page ): # tc.go("./%s" % page) if not page.startswith( "/" ): diff -r 286958ef8157 -r 39c1d12c2e7d test/functional/test_get_data.py --- a/test/functional/test_get_data.py Tue Oct 13 16:18:16 2009 -0400 +++ b/test/functional/test_get_data.py Tue Oct 13 16:37:20 2009 -0400 @@ -45,6 +45,7 @@ self.delete_history( id=self.security.encode_id( history1.id ) ) def test_005_url_paste( self ): """Test url paste behavior""" + # Logged in as admin_user # Deleting the current history should have created a new history self.check_history_for_string( 'Your history is empty' ) history2 = galaxy.model.History.filter( and_( galaxy.model.History.table.c.deleted==False, @@ -57,3 +58,38 @@ self.check_history_for_string( 'Pasted Entry' ) self.check_history_for_string( 'hello world' ) self.delete_history( id=self.security.encode_id( history2.id ) ) + def test_010_upload_lped_composite_datatype_files( self ): + """Test uploading lped composite datatype files""" + # Logged in as admin_user + self.check_history_for_string( 'Your history is empty' ) + history3 = galaxy.model.History.filter( and_( galaxy.model.History.table.c.deleted==False, + galaxy.model.History.table.c.user_id==admin_user.id ) ) \ + .order_by( desc( galaxy.model.History.table.c.create_time ) ).first() + # lped data types include a ped_file and a map_file ( which is binary ) + self.upload_composite_datatype_file( 'lped', ped_file='tinywga.ped', map_file='tinywga.map', base_name='rgenetics' ) + # Get the latest hid for testing + hda1 = galaxy.model.HistoryDatasetAssociation.query() \ + .order_by( desc( galaxy.model.HistoryDatasetAssociation.table.c.create_time ) ).first() + assert hda1 is not None, "Problem retrieving hda1 from database" + # We'll test against the resulting ped file and map file for correctness + self.verify_composite_datatype_file_content( 'rgenetics.ped', str( hda1.id ) ) + self.verify_composite_datatype_file_content( 'rgenetics.map', str( hda1.id ) ) + self.delete_history( id=self.security.encode_id( history3.id ) ) + def test_015_upload_pbed_composite_datatype_files( self ): + """Test uploading pbed composite datatype files""" + # Logged in as admin_user + self.check_history_for_string( 'Your history is empty' ) + history4 = galaxy.model.History.filter( and_( galaxy.model.History.table.c.deleted==False, + galaxy.model.History.table.c.user_id==admin_user.id ) ) \ + .order_by( desc( galaxy.model.History.table.c.create_time ) ).first() + # pbed data types include a bim_file, a bed_file and a fam_file + self.upload_composite_datatype_file( 'pbed', bim_file='tinywga.bim', bed_file='tinywga.bed', fam_file='tinywga.fam', base_name='rgenetics' ) + # Get the latest hid for testing + hda1 = galaxy.model.HistoryDatasetAssociation.query() \ + .order_by( desc( galaxy.model.HistoryDatasetAssociation.table.c.create_time ) ).first() + assert hda1 is not None, "Problem retrieving hda1 from database" + # We'll test against the resulting ped file and map file for correctness + self.verify_composite_datatype_file_content( 'rgenetics.bim', str( hda1.id ) ) + self.verify_composite_datatype_file_content( 'rgenetics.bed', str( hda1.id ) ) + self.verify_composite_datatype_file_content( 'rgenetics.fam', str( hda1.id ) ) + self.delete_history( id=self.security.encode_id( history4.id ) )
participants (1)
-
Greg Von Kuster