IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 16, 2009, 2:33:25 PM (17 years ago)
Author:
jhoblitt
Message:

add neb-rm --force flag

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/t/59_client_delete.t

    r18858 r24440  
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 9;
     12plan tests => 13;
    1313
    1414use lib qw( ./t ./lib );
     
    2626        proxy => "http://$hostport/nebulous",
    2727    );
    28     $neb->create( "foo" );
     28    my $uri = $neb->create( "foo" );
    2929
    3030    ok( $neb->delete( "foo" ), "delete object" );
     31
     32    ok( ! -e _get_file_path($uri), "deleted file" );
    3133
    3234    my $locations = $neb->find_instances( "foo" );
     
    7678}
    7779
     80# force flag
     81Test::Nebulous->setup;
     82
     83{
     84    my $neb = Nebulous::Client->new(
     85        proxy => "http://$hostport/nebulous",
     86    );
     87    $neb->create( "foo" );
     88
     89    is( $neb->delete("foo", undef), 1, "force flag false" );
     90}
     91
     92Test::Nebulous->setup;
     93
     94{
     95    my $neb = Nebulous::Client->new(
     96        proxy => "http://$hostport/nebulous",
     97    );
     98    $neb->create( "foo" );
     99
     100    is( $neb->delete("foo", 1), 1, "force flag false" );
     101}
     102
    78103Test::Nebulous->setup;
    79104
     
    84109    $neb->delete();
    85110};
    86 like( $@, qr/1 was expected/, "no params" );
     111like( $@, qr/1 - 2 were expected/, "no params" );
    87112
    88113Test::Nebulous->setup;
     
    92117        proxy => "http://$hostport/nebulous",
    93118    );
    94     $neb->delete( "foo", 2 );
     119    $neb->delete( "foo", 3);
    95120};
    96 like( $@, qr/1 was expected/, "too many params" );
     121like( $@, qr/is boolean/, "force flag not boolean" );
     122
     123Test::Nebulous->setup;
     124
     125eval {
     126    my $neb = Nebulous::Client->new(
     127        proxy => "http://$hostport/nebulous",
     128    );
     129    $neb->delete( "foo", 0, 2 );
     130};
     131like( $@, qr/1 - 2 were expected/, "too many params" );
    97132
    98133Test::Nebulous->cleanup;
Note: See TracChangeset for help on using the changeset viewer.