mediainfo 0.7.2 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,262 +0,0 @@
1
- require "test_helper"
2
- require "mediainfo_test_helper"
3
-
4
- class MediainfoVimeoTest < ActiveSupport::TestCase
5
- def setup
6
- @info = mediainfo_mock "vimeo.57652.avi"
7
- end
8
-
9
- ### GENERAL
10
-
11
- test "audio?" do
12
- assert @info.audio?
13
- end
14
-
15
- test "video?" do
16
- assert @info.video?
17
- end
18
-
19
- test "format" do
20
- assert_equal "AVI", @info.format
21
- end
22
-
23
- test "format profile" do
24
- assert_nil @info.format_profile
25
- end
26
-
27
- test "codec id" do
28
- assert_nil @info.codec_id
29
- end
30
-
31
- mediainfo_test_size
32
-
33
- test "duration" do
34
- assert_equal 15164, @info.duration
35
- assert_equal "15s 164ms", @info.duration_before_type_cast
36
- end
37
-
38
- test "overall bitrate" do
39
- assert_equal "2 078 Kbps", @info.overall_bit_rate
40
- end
41
-
42
- test "mastered date" do
43
- assert_nil @info.encoded_date
44
- end
45
-
46
- test "encoded date" do
47
- assert_nil @info.encoded_date
48
- end
49
-
50
- test "tagged date" do
51
- assert_nil @info.tagged_date
52
- end
53
-
54
- test "writing application" do
55
- assert_equal "CASIO EX-Z55", @info.writing_application
56
- end
57
-
58
- test "writing library" do
59
- assert_nil @info.writing_library
60
- end
61
-
62
- ### VIDEO
63
-
64
- test "video stream id" do
65
- assert_equal "0", @info.video.stream_id
66
- end
67
-
68
- test "video Format" do
69
- assert_equal "M-JPEG", @info.video.format
70
- end
71
-
72
- test "video format profile" do
73
- assert_nil @info.video.format_profile
74
- end
75
-
76
- test "video format version" do
77
- assert_nil @info.video.format_version
78
- end
79
-
80
- test "video format settings Matrix" do
81
- assert_nil @info.video.format_settings_matrix
82
- end
83
-
84
- test "video format settings CABAC" do
85
- assert_nil @info.video.format_settings_cabac
86
- end
87
-
88
- test "video format settings ReFrames" do
89
- assert_nil @info.video.format_settings_reframes
90
- end
91
-
92
- test "video Codec ID" do
93
- assert_equal "MJPG", @info.video.codec_id
94
- end
95
-
96
- test "video Duration" do
97
- assert_equal 15164, @info.video.duration
98
- assert_equal "15s 164ms", @info.video.duration_before_type_cast
99
- end
100
-
101
- test "video Bit rate" do
102
- assert_equal "2 019 Kbps", @info.video.bit_rate
103
- end
104
-
105
- test "video nominal bit rate" do
106
- assert_nil @info.video.nominal_bit_rate
107
- end
108
-
109
- test "video bit rate mode" do
110
- assert_nil @info.video.bit_rate_mode
111
- assert @info.video.vbr?
112
- assert !@info.video.cbr?
113
- end
114
-
115
- test "frame size" do
116
- assert_equal "320x240", @info.video.frame_size
117
- end
118
-
119
- test "video Width" do
120
- assert_equal 320, @info.video.width
121
- end
122
-
123
- test "video Height" do
124
- assert_equal 240, @info.video.height
125
- end
126
-
127
- test "video Display aspect ratio" do
128
- assert_equal "4:3", @info.video.display_aspect_ratio
129
- end
130
-
131
- test "video frame rate" do
132
- assert_equal "15.102 fps", @info.video.frame_rate
133
- assert_equal 15.102, @info.video.fps
134
- assert_equal 15.102, @info.video.framerate
135
- end
136
-
137
- test "video frame rate mode" do
138
- assert_nil @info.video.frame_rate_mode
139
- end
140
-
141
- test "video Resolution" do
142
- assert_equal 24, @info.video.resolution
143
- assert_equal "24 bits", @info.video.resolution_before_type_cast
144
- end
145
-
146
- test "video colorimetry" do
147
- assert_nil @info.video.colorimetry
148
- assert_nil @info.video.colorspace
149
- end
150
-
151
- test "video Scan type" do
152
- assert_equal "Progressive", @info.video.scan_type
153
- assert !@info.video.interlaced?
154
- assert @info.video.progressive?
155
- end
156
-
157
- test "video scan order" do
158
- assert_nil @info.video.scan_order
159
- end
160
-
161
- test "video Bits/(Pixel*Frame)" do
162
- assert_equal "1.741", @info.video.bits_pixel_frame
163
- end
164
-
165
- test "video Stream size" do
166
- assert_equal "3.65 MiB (97%)", @info.video.stream_size
167
- end
168
-
169
- ### AUDIO
170
-
171
- test "audio stream id" do
172
- assert_nil @info.audio.stream_id
173
- end
174
-
175
- test "audio Format" do
176
- assert_equal "ADPCM", @info.audio.format
177
- end
178
-
179
- test "audio format info" do
180
- assert_nil @info.audio.format_info
181
- end
182
-
183
- test "audio codec id hint" do
184
- assert_equal "Intel", @info.audio.codec_id_hint
185
- end
186
-
187
- test "audio Format settings, Endianness" do
188
- assert_nil @info.audio.format_settings_endianness
189
- end
190
-
191
- test "audio Format settings, Sign" do
192
- assert_nil @info.audio.format_settings_sign
193
- end
194
-
195
- test "audio Codec ID" do
196
- assert_equal "11", @info.audio.codec_id
197
- end
198
-
199
- test "audio Codec ID/Info" do
200
- assert_nil @info.audio.codec_info
201
- end
202
-
203
- test "audio Duration" do
204
- assert_equal 15164, @info.audio.duration
205
- assert_equal "15s 164ms", @info.audio.duration_before_type_cast
206
- end
207
-
208
- test "audio Bit rate mode" do
209
- assert_equal "Constant", @info.audio.bit_rate_mode
210
- end
211
-
212
- test "audio Bit rate" do
213
- assert_equal "44.1 Kbps", @info.audio.bit_rate
214
- end
215
-
216
- test "audio Channel(s)" do
217
- assert_equal 1, @info.audio.channels
218
- end
219
-
220
- test "audio channel positions" do
221
- assert_nil @info.audio.channel_positions
222
- end
223
-
224
- test "stereo?" do
225
- assert !@info.audio.stereo?
226
- end
227
-
228
- test "mono?" do
229
- assert @info.audio.mono?
230
- end
231
-
232
- test "audio Sampling rate" do
233
- assert_equal 11025, @info.audio.sample_rate
234
- assert_equal 11025, @info.audio.sampling_rate
235
- assert_equal "11.025 KHz", @info.audio.sampling_rate_before_type_cast
236
- end
237
-
238
- test "audio resolution" do
239
- assert_equal 4, @info.audio.resolution
240
- assert_equal "4 bits", @info.audio.resolution_before_type_cast
241
- end
242
-
243
- test "audio Stream size" do
244
- assert_equal "82.8 KiB (2%)", @info.audio.stream_size
245
- end
246
-
247
- test "audio Interleave, duration" do
248
- assert_equal "67 ms (1.00 video frame)", @info.audio.interleave_duration
249
- end
250
-
251
- test "audio encoded date" do
252
- assert_nil @info.audio.encoded_date
253
- end
254
-
255
- test "audio tagged date" do
256
- assert_nil @info.audio.tagged_date
257
- end
258
-
259
- ### IMAGE
260
-
261
- mediainfo_test_not_an_image
262
- end
data/test/test_helper.rb DELETED
@@ -1,19 +0,0 @@
1
- require "test/unit"
2
-
3
- require "rubygems"
4
- require "mocha"
5
- begin; require "redgreen"; rescue LoadError; end
6
-
7
- module ActiveSupport
8
- class TestCase < Test::Unit::TestCase
9
- def self.test(desc, &block)
10
- define_method "test #{desc}", &block
11
- end
12
-
13
- def test_yourmom; end
14
- end
15
- end
16
-
17
-
18
- $: << File.dirname(__FILE__) + "/../lib"
19
- require "mediainfo"