[Bioperl-guts-l] bioperl-live/t Sopma.t,1.7,1.8

Senduran Balasubramaniam sendu at dev.open-bio.org
Thu Jun 14 09:38:35 EDT 2007


Update of /home/repository/bioperl/bioperl-live/t
In directory dev.open-bio.org:/tmp/cvs-serv22050/t

Modified Files:
	Sopma.t 
Log Message:
moved to Test::More, 2 tests currently failing

Index: Sopma.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/Sopma.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Sopma.t	17 Sep 2005 02:11:21 -0000	1.7
--- Sopma.t	14 Jun 2007 13:38:33 -0000	1.8
***************
*** 6,23 ****
  # `make test'. After `make install' it should work as `perl test.t'
  use strict;
! use vars qw($NUMTESTS $DEBUG $ERROR $METAERROR);
! $DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
  BEGIN {
! 	# to handle systems with no installed Test module
! 	# we include the t dir (where a copy of Test.pm is located)
! 	# as a fallback
! 	eval { require Test; };
! 	$ERROR = 0;
  	if( $@ ) {
! 		use lib 't';
  	}
! 	use Test;
  
- 	$NUMTESTS = 15;
  	plan tests => $NUMTESTS;
  
--- 6,21 ----
  # `make test'. After `make install' it should work as `perl test.t'
  use strict;
! use vars qw($NUMTESTS $DEBUG);
! 
  BEGIN {
! 	$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
! 	$NUMTESTS = 16;
! 	
! 	eval { require Test::More; };
  	if( $@ ) {
! 		use lib 't/lib';
  	}
! 	use Test::More;
  
  	plan tests => $NUMTESTS;
  
***************
*** 26,59 ****
  		require LWP::UserAgent;
  	};
- 	if( $@ ) {
- 		warn("IO::String or LWP::UserAgent not installed. This means that the module is not usable. Skipping tests");
- 	$ERROR = 1;
- 	}
- 	# check this is available, set error flag if not.
- 	eval {
- 		require Bio::Seq::Meta::Array;
- 	};
  	if ($@) {
! 		warn ("Bio::Seq::Meta::Array not installed - will skip tests using meta sequences");
! 		$METAERROR = 1;
! 	}
! }
! 
! END {
! 	foreach ( $Test::ntest..$NUMTESTS) {
! 		skip('unable to run all of the Sopma tests',1);
  	}
  }
  
! exit 0 if $ERROR ==  1;
! 
! use Data::Dumper;
! use Bio::PrimarySeq;
! require Bio::Tools::Analysis::Protein::Sopma;
! 
! ok 1;
! 
! my $verbose = 0;
! $verbose = 1 if $DEBUG;
  
  ok my $tool = Bio::WebAgent->new(-verbose =>$verbose);
--- 24,36 ----
  		require LWP::UserAgent;
  	};
  	if ($@) {
! 		plan skip_all => "IO::String or LWP::UserAgent not installed. This means that the module is not usable. Skipping tests";
  	}
+ 	
+ 	use_ok('Bio::PrimarySeq');
+ 	use_ok('Bio::Tools::Analysis::Protein::Sopma');
  }
  
! my $verbose = $DEBUG;
  
  ok my $tool = Bio::WebAgent->new(-verbose =>$verbose);
***************
*** 64,73 ****
  ok $tool = Bio::Tools::Analysis::Protein::Sopma->new( -seq=>$seq,
                                                        -window_width => 15);
! if( $DEBUG ) {
! 	ok $tool->run ();
! 	exit if $tool->status eq 'TERMINATED_BY_ERROR';
  	ok my $raw = $tool->result('');
  	ok my $parsed = $tool->result('parsed');
! 	ok ($parsed->[0]{'helix'}, '104');
  	ok my @res = $tool->result('Bio::SeqFeatureI');
  	ok my $meta = $tool->result('meta', "ww15");
--- 41,54 ----
  ok $tool = Bio::Tools::Analysis::Protein::Sopma->new( -seq=>$seq,
                                                        -window_width => 15);
! 
! SKIP: {
! 	skip "Skipping tests which require remote servers - set env variable BIOPERLDEBUG to test", 12 unless $DEBUG;
! 	
! 	ok $tool->run();
! 	skip "Tool was terminated by some error: problem connecting to server?", 11 if $tool->status eq 'TERMINATED_BY_ERROR';
! 	
  	ok my $raw = $tool->result('');
  	ok my $parsed = $tool->result('parsed');
! 	is ($parsed->[0]{'helix'}, '104');
  	ok my @res = $tool->result('Bio::SeqFeatureI');
  	ok my $meta = $tool->result('meta', "ww15");
***************
*** 77,90 ****
  	ok $tool->run;
  	ok my $meta2 = $tool->result('meta', "ww21");
! 	if (!$METAERROR) { 
! 		# if Bio::Seq::Meta::Array available
! 		# meta sequence contains data...
! 		# but not available thru method call...??
! 		ok ($meta->named_submeta_text('Sopma_helix|ww15',1,2), '104 195');
! 		ok ($meta->seq, 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS');
! 	}
! } else {
! 	for ( $Test::ntest..$NUMTESTS) {
! 		skip("Skipping tests which require remote servers - set env variable BIOPERLDEBUG to test",1);
  	}
  }
--- 58,69 ----
  	ok $tool->run;
  	ok my $meta2 = $tool->result('meta', "ww21");
! 	
! 	SKIP: {
! 		eval {
! 			require Bio::Seq::Meta::Array;
! 		};
! 		skip "Bio::Seq::Meta::Array not installed - will skip tests using meta sequences", 2 if $@;
! 		is $meta->named_submeta_text('Sopma_helix|ww15',1,2), '104 195';
! 		is $meta->seq, 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS';
  	}
  }



More information about the Bioperl-guts-l mailing list