IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2870


Ignore:
Timestamp:
Jan 3, 2005, 1:48:52 PM (22 years ago)
Author:
jhoblitt
Message:

remove test skips
crude tests for valid URIs

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/t/16_client_find_instances.t

    r2868 r2870  
    66use Apache::Test qw( -withtestmore );
    77
    8 plan tests => 7;
     8plan tests => 13;
    99
    1010use lib qw( ./t ./lib );
     
    1818Test::IData->setup;
    1919
    20 SKIP: {
    21     skip "need to write a module to validate URIs", 7;
    22 
    2320{
    2421    # key
     
    2623        proxy => "http://$hostport/idata",
    2724    );
    28     my $uri = $idata->create( "foo" );
     25    $idata->create( "foo" );
    2926
    3027    my $locations = $idata->find_instances( "foo" );
    3128
    32     is( $uri, @$locations[0], "URIs match" );
     29    is( scalar @$locations, 1, "found 1" );
     30    like( @$locations[0], qr/file:/, "URIs match" );
    3331}
    3432
     
    4038        proxy => "http://$hostport/idata",
    4139    );
    42     my $uri1 = $idata->create( "foo" );
    43     my $uri2 = $idata->replicate( "foo" );
     40    $idata->create( "foo" );
     41    $idata->replicate( "foo" );
    4442
    4543    my $locations = $idata->find_instances( "foo" );
    4644
    47     ok( eq_set( [$uri1, $uri2], $locations ), "URIs match" );
     45    is( scalar @$locations, 2, "found 2" );
     46    like( @$locations[0], qr/file:/, "URIs match" );
     47    like( @$locations[1], qr/file:/, "URIs match" );
    4848}
    4949
     
    5555        proxy => "http://$hostport/idata",
    5656    );
    57     my $uri = $idata->create( "foo" );
     57    $idata->create( "foo" );
    5858
    5959    my $locations = $idata->find_instances( "foo", "node01" );
    6060
    61     is( $uri, $locations->[0], "URIs match" );
     61    is( scalar @$locations, 1, "found 1" );
     62    like( @$locations[0], qr/file:/, "URIs match" );
    6263}
    6364
     
    6970        proxy => "http://$hostport/idata",
    7071    );
    71     my $uri1 = $idata->create( "foo" );
    72     my $uri2 = $idata->replicate( "foo" );
     72    $idata->create( "foo" );
     73    $idata->replicate( "foo" );
    7374
    7475    my $locations = $idata->find_instances( "foo", "node01" );
    7576
    76     ok( eq_set( [$uri1, $uri2], $locations ), "URIs match" );
     77    is( scalar @$locations, 2, "found 2" );
     78    like( @$locations[0], qr/file:/, "URIs match" );
     79    like( @$locations[1], qr/file:/, "URIs match" );
    7780}
    7881
     
    111114
    112115Test::IData->cleanup;
    113 
    114 }
  • trunk/Nebulous/t/16_client_find_instances.t

    r2868 r2870  
    66use Apache::Test qw( -withtestmore );
    77
    8 plan tests => 7;
     8plan tests => 13;
    99
    1010use lib qw( ./t ./lib );
     
    1818Test::IData->setup;
    1919
    20 SKIP: {
    21     skip "need to write a module to validate URIs", 7;
    22 
    2320{
    2421    # key
     
    2623        proxy => "http://$hostport/idata",
    2724    );
    28     my $uri = $idata->create( "foo" );
     25    $idata->create( "foo" );
    2926
    3027    my $locations = $idata->find_instances( "foo" );
    3128
    32     is( $uri, @$locations[0], "URIs match" );
     29    is( scalar @$locations, 1, "found 1" );
     30    like( @$locations[0], qr/file:/, "URIs match" );
    3331}
    3432
     
    4038        proxy => "http://$hostport/idata",
    4139    );
    42     my $uri1 = $idata->create( "foo" );
    43     my $uri2 = $idata->replicate( "foo" );
     40    $idata->create( "foo" );
     41    $idata->replicate( "foo" );
    4442
    4543    my $locations = $idata->find_instances( "foo" );
    4644
    47     ok( eq_set( [$uri1, $uri2], $locations ), "URIs match" );
     45    is( scalar @$locations, 2, "found 2" );
     46    like( @$locations[0], qr/file:/, "URIs match" );
     47    like( @$locations[1], qr/file:/, "URIs match" );
    4848}
    4949
     
    5555        proxy => "http://$hostport/idata",
    5656    );
    57     my $uri = $idata->create( "foo" );
     57    $idata->create( "foo" );
    5858
    5959    my $locations = $idata->find_instances( "foo", "node01" );
    6060
    61     is( $uri, $locations->[0], "URIs match" );
     61    is( scalar @$locations, 1, "found 1" );
     62    like( @$locations[0], qr/file:/, "URIs match" );
    6263}
    6364
     
    6970        proxy => "http://$hostport/idata",
    7071    );
    71     my $uri1 = $idata->create( "foo" );
    72     my $uri2 = $idata->replicate( "foo" );
     72    $idata->create( "foo" );
     73    $idata->replicate( "foo" );
    7374
    7475    my $locations = $idata->find_instances( "foo", "node01" );
    7576
    76     ok( eq_set( [$uri1, $uri2], $locations ), "URIs match" );
     77    is( scalar @$locations, 2, "found 2" );
     78    like( @$locations[0], qr/file:/, "URIs match" );
     79    like( @$locations[1], qr/file:/, "URIs match" );
    7780}
    7881
     
    111114
    112115Test::IData->cleanup;
    113 
    114 }
Note: See TracChangeset for help on using the changeset viewer.