Changeset 17756 for trunk/Nebulous/t/57_client_find.t
- Timestamp:
- May 19, 2008, 5:46:11 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/t/57_client_find.t (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/t/57_client_find.t
r5667 r17756 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 57_client_find.t,v 1. 1 2005-12-03 02:52:31 jhoblitt Exp $5 # $Id: 57_client_find.t,v 1.2 2008-05-20 03:46:11 jhoblitt Exp $ 6 6 7 7 use strict; … … 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 4;12 plan tests => 7; 13 13 14 14 use lib qw( ./t ./lib ); … … 37 37 38 38 { 39 # key, volume 40 my $neb = Nebulous::Client->new( 41 proxy => "http://$hostport/nebulous", 42 ); 43 my $uri = $neb->create( "foo", "node01" ); 44 45 my $path = $neb->find( "foo", "node01" ); 46 47 ok( -e $path, "file exists" ); 48 } 49 50 Test::Nebulous->setup; 51 52 { 53 # key, volume does not hold key but this works anyways ans find will fall 54 # back to looking for ":any" 55 my $neb = Nebulous::Client->new( 56 proxy => "http://$hostport/nebulous", 57 ); 58 my $uri = $neb->create( "foo", "node01" ); 59 60 my $path = $neb->find( "foo", "node02" ); 61 62 ok( -e $path, "file exists" ); 63 } 64 65 Test::Nebulous->setup; 66 67 { 68 # key, volume :any 69 my $neb = Nebulous::Client->new( 70 proxy => "http://$hostport/nebulous", 71 ); 72 my $uri = $neb->create( "foo", "node01" ); 73 74 my $path = $neb->find( "foo", ":any" ); 75 76 ok( -e $path, "file exists" ); 77 } 78 79 Test::Nebulous->setup; 80 81 { 39 82 my $neb = Nebulous::Client->new( 40 83 proxy => "http://$hostport/nebulous", … … 43 86 my $path = $neb->find( "foo" ); 44 87 45 ok( ! -e $path, "file doesn't exist" );88 is($path, undef, "file doesn't exist" ); 46 89 } 47 90 … … 55 98 $neb->find(); 56 99 }; 57 like( $@, qr/1 wasexpected/, "no params" );100 like( $@, qr/1 - 2 were expected/, "no params" ); 58 101 59 102 Test::Nebulous->setup; … … 64 107 ); 65 108 66 $neb->find( "foo", "bar" );109 $neb->find( "foo", "bar", "bong" ); 67 110 }; 68 like( $@, qr/1 wasexpected/, "too many params" );111 like( $@, qr/1 - 2 were expected/, "too many params" ); 69 112 70 113 Test::Nebulous->cleanup;
Note:
See TracChangeset
for help on using the changeset viewer.
