1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #!/usr/bin/python
- import devices
- from sikuli.Sikuli import *
- import config
- from lvcgui import MVCGui
- import datafiles
- data = datafiles.TestData()
- def test_android_conversions():
- """Scenario: test each android conversion option.
- """
- device_list = devices.devices('Android')
- for x in device_list:
- yield convert_to_format, x
- def test_android_size_output_default():
- """Scenario: the output format and size are defaults when device selected.
- """
- device_list = devices.devices('Android')
- datadir, testfiles = data.test_data(many=True, new=True)
- lvc = MVCGui()
- lvc.lvc_focus()
- lvc.browse_for_files(datadir, testfiles)
- for x in device_list:
- yield device_defaults, x, lvc
- def device_defaults(device_output, lvc):
- print(device_output)
- lvc.choose_device_conversion(device_output)
- width = devices.device_attr(device_output, 'width')
- height = devices.device_attr(device_output, 'height')
- default_format = 'MP4'
- assert lvc.verify_device_format_selected(device_output)
- assert lvc.verify_device_size_default(str(width), str(height))
- def convert_to_format(device_output):
- """Scenario: Test items are converted to the specified format.
- """
- print(device_output)
- lvc = MVCGui()
- lvc.lvc_focus()
- expected_failures = ['fake_video.mp4']
- datadir, testfiles = data.test_data(many=True, new=True)
- lvc.browse_for_files(datadir, testfiles)
- output_dir = tempfile.mkdtemp()
- lvc.choose_save_location(output_dir)
- lvc.choose_device_conversion("device_output")
- lvc.start_conversions()
- for item in testfiles:
- if item in expected_failures:
- lvc.verify_failed(item, 120)
- else:
- lvc.verify_completed(item, 120)
- lvc.clear_finished_files(item)
- lvc.clear_and_start_over()
|