Changeset 20988 for trunk/Nebulous/t/62_client_delete_instance.t
- Timestamp:
- Dec 14, 2008, 12:48:35 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/t/62_client_delete_instance.t (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/t/62_client_delete_instance.t
r20965 r20988 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 62_client_delete_instance.t,v 1. 2 2008-12-12 21:13:41 jhoblittExp $5 # $Id: 62_client_delete_instance.t,v 1.3 2008-12-14 22:48:35 eugene Exp $ 6 6 7 7 use strict; … … 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 11;12 plan tests => 9; 13 13 14 14 use lib qw( ./t ./lib ); … … 26 26 proxy => "http://$hostport/nebulous", 27 27 ); 28 $neb->create( "foo" ); 28 29 29 my $key = "foo"; 30 $neb->create($key); 30 my $locations = $neb->find_instances( "foo" ); 31 31 32 my $locations = $neb->find_instances($key); 33 34 my $uri = $neb->delete_instance($key, @$locations[0]); 32 my $uri = $neb->delete_instance( @$locations[0] ); 35 33 36 34 is( $uri, @$locations[0], "delete instance" ); … … 45 43 proxy => "http://$hostport/nebulous", 46 44 ); 47 my $key = "foo"; 48 $neb->create($key); 49 $neb->replicate($key); 45 $neb->create( "foo" ); 46 $neb->replicate( "foo" ); 50 47 51 48 my $uri1 = $neb->find_instances( "foo" )->[0]; 52 49 53 ok( $neb->delete_instance( $key, $uri1), "delete instance" );50 ok( $neb->delete_instance( $uri1 ), "delete instance" ); 54 51 55 52 my $uri2 = $neb->find_instances( "foo" )->[0]; … … 57 54 isnt( $uri1, $uri2, "other instance remains" ); 58 55 59 ok( $neb->delete_instance( $key, $uri2), "delete instance" );56 ok( $neb->delete_instance( $uri2 ), "delete instance" ); 60 57 61 58 my $locations = $neb->find_instances( "foo" ); 62 59 63 is( $locations, undef, "no rema ining instances" );60 is( $locations, undef, "no remaning instances" ); 64 61 } 65 66 Test::Nebulous->setup;67 62 68 63 { … … 70 65 proxy => "http://$hostport/nebulous", 71 66 ); 72 my $key = "foo"; 73 $neb->create($key); 74 my $uri = $neb->delete_instance($key, "file:/foo" ); 67 my $uri = $neb->delete_instance( "file:/foo" ); 75 68 76 69 is( $uri, undef, "uri does not exist" ); … … 83 76 proxy => "http://$hostport/nebulous", 84 77 ); 85 my $uri = $neb->delete_instance("foo", "file:/foo");78 $neb->delete_instance(); 86 79 }; 87 like( $@, qr/ is valid object key/, "bad object key" );80 like( $@, qr/1 was expected/, "no params" ); 88 81 89 82 Test::Nebulous->setup; … … 93 86 proxy => "http://$hostport/nebulous", 94 87 ); 95 my $uri = $neb->delete_instance("foo");88 $neb->delete_instance( "foo", 2 ); 96 89 }; 97 like( $@, qr/2 were expected/, "missing second param" ); 98 99 Test::Nebulous->setup; 100 101 eval { 102 my $neb = Nebulous::Client->new( 103 proxy => "http://$hostport/nebulous", 104 ); 105 $neb->delete_instance(); 106 }; 107 like( $@, qr/2 were expected/, "no params" ); 108 109 Test::Nebulous->setup; 110 111 eval { 112 my $neb = Nebulous::Client->new( 113 proxy => "http://$hostport/nebulous", 114 ); 115 $neb->delete_instance("foo", 2, 3); 116 }; 117 like( $@, qr/2 were expected/, "too many params" ); 90 like( $@, qr/1 was expected/, "too many params" ); 118 91 119 92 Test::Nebulous->cleanup;
Note:
See TracChangeset
for help on using the changeset viewer.
