/
10.atomic-parsley.t
128 lines (113 loc) · 4.02 KB
/
10.atomic-parsley.t
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
use Modern::Perl;
use IO::All;
use Media;
use Test::More tests => 6;
# check the parsing of AtomicParsley output
my $media = Media->new( 't/conf/media.conf' );
my $handler = $media->get_empty_handler( 'Movie', 'VideoFile' );
{
my $content < io 't/atomic-parsley/barbarella_tags.txt';
my %metadata = $handler->parse_metadata( $content );
is_deeply(
\%metadata,
{
artist => 'Roger Vadim',
artwork_count => '1',
genre => 'Adventure',
kind => 'Movie',
rating => 'X',
title => 'Barbarella',
year => '1968',
}
);
}
{
my $content < io 't/atomic-parsley/barbarella_atom.txt';
my @atoms = $handler->parse_atom_tree( $content );
is_deeply(
\@atoms,
[
{
kind => 'avc1',
type => 'vide',
},
{
kind => 'ac-3',
type => 'soun',
},
{
kind => 'mp4a',
type => 'soun',
},
]
);
}
{
my $content < io 't/atomic-parsley/serenity_tags.txt';
my %metadata = $handler->parse_metadata( $content );
is_deeply(
\%metadata,
{
artwork_count => 1,
artist => 'Joss Whedon',
description => 'In the future, a spaceship called Serenity is harboring a passenger with a deadly secret. Six rebels on the run. An assassin in pursuit. When the renegade crew of Serenity agrees to hide a fugitive on their ship, they find themselves in an awesome action-packed battle between the relentless military might of a totalitarian regime who will destroy anything - or anyone - to get the girl back and the bloodthirsty creatures who roam the uncharted areas of space. But, the greatest danger of all may be on their ship.',
genre => 'Action',
kind => 'Movie',
rating => '15',
summary => 'In the future, a spaceship called Serenity is harboring a passenger with a deadly secret. Six rebels on the run. An assassin in pursuit. When the renegade crew of Serenity agrees to hide a fugitive on their ship, they find themselves in an awesome action-p',
title => 'Serenity',
year => '2005',
}
);
}
$handler = $media->get_empty_handler( 'TV', 'VideoFile' );
{
my $content < io 't/atomic-parsley/bsg_tags.txt';
my %metadata = $handler->parse_metadata( $content );
is_deeply(
\%metadata,
{
kind => 'TV Show',
series => 'Battlestar Galactica (2003)',
season => '1',
episode => '3',
episode_id => '1x03',
title => 'Bastille Day',
}
);
}
{
my $content < io 't/atomic-parsley/bsg_atom.txt';
my @atoms = $handler->parse_atom_tree( $content );
is_deeply(
\@atoms,
[
{
kind => 'avc1',
type => 'vide',
},
{
kind => 'ac-3',
type => 'soun',
},
{
kind => 'mp4a',
type => 'soun',
},
]
);
}
$handler = $media->get_empty_handler( 'MusicVideo', 'VideoFile' );
{
my $content < io 't/atomic-parsley/ghost_train_tags.txt';
my %metadata = $handler->parse_metadata( $content );
is_deeply(
\%metadata,
{
artist => 'Madness',
album => 'Utter Madness',
title => '(Waiting for) The Ghost Train',
kind => 'Music Video',
}
);
}