IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 24, 2006, 6:48:25 PM (20 years ago)
Author:
jhoblitt
Message:

add DataStore::FileSet::Parser->new( base_uri => ... )
add DataStore::FileSet::Parser->base_uri()
add DataStore::FileSet::Record->uri()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/t/02_fileset_parse.t

    r6491 r6497  
    33# Copyright (C) 2006  Joshua Hoblitt
    44#
    5 # $Id: 02_fileset_parse.t,v 1.3 2006-02-25 00:13:36 jhoblitt Exp $
     5# $Id: 02_fileset_parse.t,v 1.4 2006-02-25 04:48:25 jhoblitt Exp $
    66
    77use strict;
     
    1010use lib qw( ./lib ./t );
    1111
    12 use Test::More tests => 38;
     12use Test::More tests => 42;
    1313use Test::Warn;
    1414
     
    114114otis0123456|2006-01-01T00:03:04Z|object|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
    115115END
    116     my $results = DataStore::FileSet::Parser->new->parse($example1);
     116    my $parser  = DataStore::FileSet::Parser->new(
     117        base_uri => 'http://foo.com/'
     118    );
     119    my $results = $parser->parse($example1);
    117120
    118121    is(scalar @$results, 4, "correct number of item returned");
     
    122125    is(@$results[0]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
    123126    is(@$results[0]->type, 'object', 'correct type');
     127    is(@$results[0]->uri, 'http://foo.com/otis0123456', 'correct uri');
    124128
    125129    isa_ok(@$results[1], 'DataStore::FileSet::Record');
     
    127131    is(@$results[1]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
    128132    is(@$results[1]->type, 'object', 'correct type');
     133    is(@$results[1]->uri, 'http://foo.com/otis0123456', 'correct uri');
    129134
    130135    isa_ok(@$results[2], 'DataStore::FileSet::Record');
     
    132137    is(@$results[2]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
    133138    is(@$results[2]->type, 'object', 'correct type');
     139    is(@$results[2]->uri, 'http://foo.com/otis0123456', 'correct uri');
    134140
    135141    isa_ok(@$results[3], 'DataStore::FileSet::Record');
     
    137143    is(@$results[3]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
    138144    is(@$results[3]->type, 'object', 'correct type');
     145    is(@$results[3]->uri, 'http://foo.com/otis0123456', 'correct uri');
    139146}
    140147
Note: See TracChangeset for help on using the changeset viewer.