File: store.t

package info (click to toggle)
libcatmandu-aat-perl 0.03-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 180 kB
  • sloc: perl: 245; makefile: 10
file content (49 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use strict;
use warnings;
use Test::More;

use Catmandu::Fix;

my $pkg;

BEGIN {
    plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};

    $pkg = 'Catmandu::Store::AAT';
    use_ok $pkg;
}

my $record = {
    'objectName' => '300033618'
};

my $record_lang = {
    'objectName' => '300033618'
};

my $fixer = Catmandu::Fix->new(fixes => ['lookup_in_store(objectName, AAT)']);
my $fixer_lang = Catmandu::Fix->new(fixes => ['lookup_in_store(objectName, AAT, lang:en)']);

$fixer->fix($record);
$fixer_lang->fix($record_lang);

my $expected = {
    'objectName' => {
        'id' => '300033618',
        'prefLabel' => 'schilderingen',
        'uri' => 'http://vocab.getty.edu/aat/300033618'
    }
};

my $expected_lang = {
    'objectName' => {
        'id' => '300033618',
        'prefLabel' => 'paintings (visual works)',
        'uri' => 'http://vocab.getty.edu/aat/300033618'
    }
};

is_deeply $record, $expected;
is_deeply $record_lang, $expected_lang;

done_testing 3;