File: 50mets.t

package info (click to toggle)
libhttp-oai-perl 4.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 436 kB
  • sloc: perl: 2,599; xml: 224; makefile: 15
file content (24 lines) | stat: -rw-r--r-- 522 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use Test::More tests => 3;

use IO::File;
use HTTP::OAI;
use HTTP::OAI::Metadata::METS;

ok(1);

my $fh;

my $r = HTTP::OAI::GetRecord->new(handlers=>{
	metadata=>'HTTP::OAI::Metadata::METS'
});
$fh = IO::File->new('examples/mets.xml','r') or die "Unable to open examples/mets.xml: $!";
$r->parse_file($fh);
$fh->close();

my $rec = $r->record;

my @files = $rec->metadata->files;

is(scalar(@files), 4, 'file_count');

is($files[1]->{ url }, "http://dspace.mit.edu/bitstream/1721.1/8338/2/50500372-MIT.pdf", 'file_url');