"
},
"resourceUrl": "resource_123"
"
},
"resourceUrl": "resource_123"
}
],
"creationStatus": "COMMITTED"
},
"region": {
"regionId": "cn-hongkong",
"regionName": "HongKong",
"regionEndpoint": "mediaedit.aliyuncs.com"
}
}
}
data = JSON.parse(data)
describe 'Elastic Transcoder MNS notify handler' do
it "should handle Elastic Transcoder MNS notify" do
ElasticTranscoder::MNSNotifyJobHandler.perform(data)
end
it 'should handle Elastic Transcoder MNS notify with callback method option' do
ElasticTranscoder::MNSNotifyJobHandler.perform(data, ElasticTranscoder::TestJobCallback, :after_transcoded)
end
end
describe 'Elastic Transcoder job monitor' do
it 'should get job status' do
job = ElasticTranscoder::Job.new "YWg7BgTfQM6GvJlUiqMvs63U0T4Jl0OM84VjeM9xU20zYOoGF1wQow=="
response = job.status
# It will be pending, or error, or success, or warning
status = response['Status']
end
end
describe 'Elastic Transcoder pipeline' do
it 'should get pipeline list' do
pipelines = ElasticTranscoder::Pipeline.list
end
it 'should get pipeline detail' do
pipeline = ElasticTranscoder::Pipeline.new "12345678"
response = pipeline.detail
assert_equal response['Id'], "12345678"
end
it 'should create a new pipeline' do
pipeline = ElasticTranscoder::Pipeline.new
response = pipeline.create 'remote_sina_file', 'transcoded'
# It will be active, paused, or deleted
state = response['State']
end
it 'should get pipeline status' do
pipeline = ElasticTranscoder::Pipeline.new "12345678"
# active, paused, or deleted
pipeline_status = pipeline.status
end
it 'should update pipeline' do
pipeline = ElasticTranscoder::Pipeline.new "12345678"
response = pipeline.update 'transcoded', 'remote_sina_file'
# It will be active, paused, or deleted
state = response['State']
end
it 'should delete pipeline' do
pipeline = ElasticTranscoder::Pipeline.new "12345678"
response = pipeline.delete
# It will be active, paused, or deleted
state = response['State']
end
end
describe 'Elastic Transcoder input' do
it 'should get input id' do
input = ElasticTranscoder::Input.new("12345678")
assert_equal input.id, '12345678'
end
end
describe 'Elastic Transcoder output' do
it 'should get output id' do
output = ElasticTranscoder::Output.new("12345678")
assert_equal output.id, '12345678'
end
end
describe 'Elastic Transcoder preset' do
it 'should get preset list' do
presets = ElasticTranscoder::Preset.list
end
it 'should get preset detail' do
preset = ElasticTranscoder::Preset.new "12345678"
response = preset.detail
assert_equal response['Id'], '12345678'
end
it 'should create a new preset' do
preset = ElasticTranscoder::Preset.new
response = preset.create 'Hls_256k', 'webm', 'vp8', 'transcoded'
# It will be active, paused, or deleted
state = response['State']
end
it 'should update preset' do
preset = ElasticTranscoder::Preset.new
response = preset.update 'Hls_256k', 'webm', 'vp8', 'transcoded'
# It will be active, paused, or deleted
state = response['State']
end
it 'should delete preset' do
preset = ElasticTranscoder::Preset.new "12345678"
response = preset.delete
# It will be active, paused, deleted
state = response['State']
end
end
describe 'Elastic Transcoder jobs' do
it 'should list jobs' do
jobs = ElasticTranscoder::Job.list
end
end
describe 'Elastic Transcoder playlist' do
it 'should list playlists' do
playlists = ElasticTranscoder::Playlist.list
end
it 'should get playlist detail' do
playlist = ElasticTranscoder::Playlist.new "12345678"
response = playlist.detail
end
end
describe 'Elastic Transcoder thumbnail' do
it 'should get thumbnail detail' do
thumbnail = ElasticTranscoder::Thumbnail.new "12345678"
response = thumbnail.detail
end
end详情