[MOBY-guts] biomoby commit
Frank Gibbons
fgibbons at pub.open-bio.org
Fri Sep 16 16:38:15 UTC 2005
fgibbons
Fri Sep 16 12:38:15 EDT 2005
Update of /home/repository/moby/moby-live/Perl/t
In directory pub.open-bio.org:/tmp/cvs-serv23713/t
Modified Files:
Client-OntologyServer.t
Log Message:
- TODO list updated:
* "Everything" removed (I'm an optimist).
* Can't set proxy to default value 'undef', once changed.
* relationshipExists is not implemented, so it's SKIPped.
(Leaving it on the TODO list creates error messages on 'make test')
moby-live/Perl/t Client-OntologyServer.t,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/06 20:43:21 1.3
+++ /home/repository/moby/moby-live/Perl/t/Client-OntologyServer.t 2005/09/16 16:38:15 1.4
@@ -12,7 +12,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
#use SOAP::Lite +trace;
-use Test::More 'no_plan'; # perldoc Test::More for details
+use Test::More 'no_plan'; #skip_all => "Skipped for development"; #'no_plan'; # perldoc Test::More for details
use strict;
use MOBY::Client::OntologyServer;
#Is the client-code even installed?
@@ -23,19 +23,30 @@
};
-TODO: {
- local $TODO = "Everything.";
-}
-
my @autoload = qw/host proxy/;
my @API = (@autoload, qw/new getUserAgent
-objectExists serviceExists namespaceExists relationshipExists/);
+objectExists serviceExists namespaceExists /);
my $os = MOBY::Client::OntologyServer->new();
foreach (@autoload) {eval{$os->$_};} # Call all AUTOLOAD methods, to create them.
can_ok("MOBY::Client::OntologyServer", @API)
or diag("OntologyServer doesn't implement full API");
+# Check that accessor methods work correctly;
+my ($old_host, $old_proxy) = ($os->host(), $os->proxy());
+my ($new_host, $new_proxy) = ("foo.cgi", "bar");
+is($os->host($new_host), $new_host) or diag("Couldn't set new host");
+is($os->host(), $new_host) or diag("Couldn't get host");
+is($os->host($old_host), $old_host) or diag("Couldn't return host to previous value");
+ is($os->proxy($new_proxy), $new_proxy) or diag("Couldn't set proxy to new value");
+ is($os->proxy(), $new_proxy) or diag("Couldn't get proxy");
+TODO: {
+ local $TODO = "How come I cant' set proxy back to its original value?";
+ is($os->proxy($old_proxy), $old_proxy) or diag("Couldn't return proxy to previous value");
+}
+
+# Start fresh....
+$os = MOBY::Client::OntologyServer->new();
################ CHECK THAT VALID STUFF RETURNS CORRECTLY ##########
#
# It would really be better not to have literal lists of valid namespaces here,
@@ -69,14 +80,23 @@
or diag("Service type '$_' reported erroneously as non-existent.");
}
-TODO: {
- local $TODO = "Fix whatever is broken with these relationship types - or else fix this test.";
+SKIP: {
+ skip "relationshipExists not implemented", 5
+ unless MOBY::Client::OntologyServer->can("relationshipExists");
+
+ can_ok("MOBY::Client::OntologyServer", "relationshipExists")
+ or diag("OntologyServer should be able to tell whether a relationship exists");
my @check_rel = qw/ISA HASA HAS/; # There should only be very few valid relationship types.
foreach (@check_rel) {
($success, $msg, $existingURI) = $os->relationshipExists(term => $_);
is($success, 1)
or diag("Relationship '$_' reported erroneously as non-existent.");
}
+
+ my $invalid_rel = "HA";
+ ($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel);
+ is($success, 0)
+ or diag("Relationship '$invalid_rel' reported erroneously as existent.");
}
@@ -100,7 +120,3 @@
is($success, 0)
or diag("Service type '$invalid_st' reported erroneously as existent.");
-my $invalid_rel = "HA";
-($success, $msg, $existingURI) = $os->relationshipExists(term => $invalid_rel);
-is($success, 0)
- or diag("Relationship '$invalid_rel' reported erroneously as existent.");
More information about the MOBY-guts
mailing list